|
|
|
@ -21,9 +21,9 @@ class Vendor_money extends CI_Controller {
|
|
|
|
|
$this->load->view('vendor_money_sum', $data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function index()
|
|
|
|
|
public function index($download_vendor=null)
|
|
|
|
|
{
|
|
|
|
|
$this->permission->is_admin(true);
|
|
|
|
|
// $this->permission->is_admin(true); // test:
|
|
|
|
|
$date_range = $this->input->post("date_range");
|
|
|
|
|
preg_match_all('/\d{4}\-\d{2}\-\d{2}/', $date_range, $date_range_arr);
|
|
|
|
|
if (empty($date_range_arr[0])) {
|
|
|
|
@ -36,6 +36,12 @@ class Vendor_money extends CI_Controller {
|
|
|
|
|
}
|
|
|
|
|
$vendors = $this->input->post("vendors");
|
|
|
|
|
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
|
|
|
|
|
if ($download_vendor !== null) {
|
|
|
|
|
$vendors = array($download_vendor);
|
|
|
|
|
$sourcetype = $vendor_sourcetype[strval($download_vendor)]["sourcetype"];
|
|
|
|
|
$vendor_data = $this->money_model->group_detail_list($download_vendor, $sourcetype, $start_date, $end_date, implode(',', $vendors));
|
|
|
|
|
return $this->output->set_content_type('application/json')->set_output(json_encode($vendor_data, JSON_UNESCAPED_UNICODE));
|
|
|
|
|
}
|
|
|
|
|
$result = array(
|
|
|
|
|
"default_date1" => $start_date
|
|
|
|
|
,"default_date2" => $end_date
|
|
|
|
@ -185,11 +191,34 @@ class Vendor_money extends CI_Controller {
|
|
|
|
|
$result['col_sum']['trippest']['sum_payout'] = bcadd($result['col_sum']['trippest']['sum_payout'], $vmi['trippest']['payout']);
|
|
|
|
|
$result['col_sum']['vendor']['sum_payout'] = bcadd($result['col_sum']['vendor']['sum_payout'], $vmi['vendor']['payout']);
|
|
|
|
|
}
|
|
|
|
|
// return $this->output->set_content_type('application/json')->set_output(json_encode($result));
|
|
|
|
|
$this->load->view('vendor_money_sum', $result);
|
|
|
|
|
return ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function detail($download_vendor=null)
|
|
|
|
|
{
|
|
|
|
|
// $this->permission->is_admin(true); // test:
|
|
|
|
|
$date_range = $this->input->post("date_range");
|
|
|
|
|
preg_match_all('/\d{4}\-\d{2}\-\d{2}/', $date_range, $date_range_arr);
|
|
|
|
|
if (empty($date_range_arr[0])) {
|
|
|
|
|
return $this->settlement();
|
|
|
|
|
}
|
|
|
|
|
$start_date = $date_range_arr[0][0];
|
|
|
|
|
$end_date =$date_range_arr[0][1] . " 23:59:59";
|
|
|
|
|
if ($end_date == null) {
|
|
|
|
|
$end_date = date("Y-m-d H:i:s", strtotime("+1 month", strtotime($start_date))-1);
|
|
|
|
|
}
|
|
|
|
|
$vendors = $this->input->post("vendors");
|
|
|
|
|
if ($download_vendor !== null) {
|
|
|
|
|
$vendors = array($download_vendor);
|
|
|
|
|
}
|
|
|
|
|
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
|
|
|
|
|
$sourcetype = $vendor_sourcetype[strval($download_vendor)]["sourcetype"];
|
|
|
|
|
$vendor_data = $this->money_model->group_detail_list($download_vendor, $sourcetype, $start_date, $end_date, implode(',', $vendors));
|
|
|
|
|
return $this->output->set_content_type('application/json')->set_output(json_encode($vendor_data));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* End of file vendor_money.php */
|
|
|
|
|