Merge branch 'feature/pay'

mobile-first
lyt 5 years ago
commit 1e66f29570

@ -1416,6 +1416,9 @@ class Index extends CI_Controller {
{ {
$to_date = date('Y-m-d', strtotime("+$days days", strtotime($from_date))); $to_date = date('Y-m-d', strtotime("+$days days", strtotime($from_date)));
$former_list = $this->Note_model->date_range($from_date, $to_date, $currency, $last_sn, false); $former_list = $this->Note_model->date_range($from_date, $to_date, $currency, $last_sn, false);
if (empty($former_list)) {
$former_list = $this->Note_model->top_list(100, $currency, $last_sn, false);
}
$list_index = 0; $list_index = 0;
$last_sn = $last_sn===null ? 0 : $last_sn; $last_sn = $last_sn===null ? 0 : $last_sn;
$last_flag = $last_flag===null ? null : $last_flag; $last_flag = $last_flag===null ? null : $last_flag;

@ -175,6 +175,24 @@ class Note_model extends CI_Model {
$this->orderby = " order by pn.pn_sn asc"; $this->orderby = " order by pn.pn_sn asc";
return $this->get_list(); return $this->get_list();
} }
public function top_list($top, $currency=NULL, $pn_sn=NULL, $includeWH=true)
{
$this->init();
$this->topnum = $top;
$search_sql = " AND pn_payment_status in ('Completed','Refunded') ";
if ( ! empty($currency)) {
$search_sql .= " AND pn_mc_currency = '$currency' ";
}
if ( ! empty($pn_sn)) {
$search_sql .= " AND pn_sn >= $pn_sn ";
}
if (true !== $includeWH) {
$search_sql .= " AND isnull(pn_payer,'')<>'' and ISNULL(pn_payer_email,'')<>'' ";
}
$this->search = $search_sql;
$this->orderby = " order by pn.pn_sn asc";
return $this->get_list();
}
/** /**

Loading…
Cancel
Save