|
|
|
@ -66,6 +66,15 @@ class Note_model extends CI_Model {
|
|
|
|
|
return $this->get_list();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function noteaccount($topnum = 2, $account = '') {
|
|
|
|
|
$this->init();
|
|
|
|
|
$this->topnum = $topnum;
|
|
|
|
|
$x_str = strtolower($account);
|
|
|
|
|
$sql4 = " AND (pn_memo like '%\"business\":\"$x_str\"%') ";
|
|
|
|
|
$this->pn_send = $sql4;
|
|
|
|
|
return $this->get_list();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function search_date($date) {
|
|
|
|
|
$this->init();
|
|
|
|
|
$search_sql = " AND (pn.pn_datetime BETWEEN '$date 00:00:00' AND '$date 23:59:59' OR isnull(pn_send,'') in ('sendfail','unsend','')) ";
|
|
|
|
@ -155,7 +164,27 @@ class Note_model extends CI_Model {
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return $query->result();
|
|
|
|
|
$result = $query->result();
|
|
|
|
|
array_walk($result, 'note_model::set_fundsource');
|
|
|
|
|
return $result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private $code_fundsource = array(
|
|
|
|
|
"pay@trippest.com" => "Trippest", // business":"pay@trippest.com"
|
|
|
|
|
"pays@chinahighlights.com" => "", // "CHT",
|
|
|
|
|
"paypal@chinahighlights.com" => "2", // "CHT",
|
|
|
|
|
"0" => "unknown",
|
|
|
|
|
);
|
|
|
|
|
public function set_fundsource(&$ele)
|
|
|
|
|
{
|
|
|
|
|
$ele->fundsource = "";
|
|
|
|
|
$raw = json_decode($ele->pn_memo);
|
|
|
|
|
$business = isset($raw->business) ? $raw->business : '0';
|
|
|
|
|
if ($this->code_fundsource[$business]) {
|
|
|
|
|
$ele->fundsource = $this->code_fundsource[$business];
|
|
|
|
|
}
|
|
|
|
|
if ( ! isset($raw->ipn_track_id) && (isset($raw->id) && strpos($raw->id, "WH-") === 0)) {
|
|
|
|
|
$ele->fundsource = '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|