|
|
@@ -14,12 +14,11 @@ class Workshopshow extends Start_Controller
|
|
|
}
|
|
|
public function _remap($arg, $arg_array)
|
|
|
{
|
|
|
-
|
|
|
if ($arg == 'xdshow') //调出单
|
|
|
{
|
|
|
$this->_xdshow();
|
|
|
- }elseif($arg == 'bhshow'){
|
|
|
- $this->_bhshow();
|
|
|
+ }elseif($arg == 'ordercount'){
|
|
|
+ $this->_orderCount();
|
|
|
}else {
|
|
|
$this->_index();
|
|
|
}
|
|
|
@@ -28,11 +27,71 @@ class Workshopshow extends Start_Controller
|
|
|
exit('No direct script access allowed');
|
|
|
}
|
|
|
private function _xdshow(){
|
|
|
- $this->_Template('workshopshow_xdshow', $this->data);
|
|
|
- }
|
|
|
- private function _bhshow(){
|
|
|
- $this->_Template('workshopshow_bhshow', $this->data);
|
|
|
+ if($this->input->method(TRUE) == 'POST'){
|
|
|
+ $params = $this->input->post();
|
|
|
+ echo "<pre>";
|
|
|
+ print_r($params);
|
|
|
+ die;
|
|
|
+ }else{
|
|
|
+ $this->_Template('workshopshow_xdshow', $this->data);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ //以布标为基准,
|
|
|
+ private function _bbCount(){
|
|
|
+
|
|
|
+ }
|
|
|
+ //以打印发货单的时间为基准, 超七天未出货单
|
|
|
+ private function _orderCount(){
|
|
|
+ $dlz_r = $this->_tj7daywck("fullorder");
|
|
|
+ $tt_r = $this->_tj7daywck("fullordertt");
|
|
|
+ $amz_r = $this->_tj7daywck("fullorderamz");
|
|
|
+ $smt_r = $this->_tj7daywck("fullordersmt");
|
|
|
+ $order_num_7 = $dlz_r['total_orders']*1 + $tt_r['total_orders']*1 + $amz_r['total_orders']*1 + $smt_r['total_orders']*1;
|
|
|
+ $ts_7 = $dlz_r['total_products']*1 + $tt_r['total_products']*1 + $amz_r['total_products']*1 + $smt_r['total_products']*1;
|
|
|
+
|
|
|
+ $dlz_m = $this->_tjwfhd("fullorder");
|
|
|
+ $tt_m = $this->_tjwfhd("fullordertt");
|
|
|
+ $amz_m = $this->_tjwfhd("fullorderamz");
|
|
|
+ $smt_m = $this->_tjwfhd("fullordersmt");
|
|
|
+ $order_num_m = $dlz_m['total_orders']*1 + $tt_m['total_orders']*1 + $amz_m['total_orders']*1 + $smt_m['total_orders']*1;
|
|
|
+ $ts_m = $dlz_m['total_products']*1 + $tt_m['total_products']*1 + $amz_m['total_products']*1 + $smt_m['total_products']*1;
|
|
|
+ echo json_encode([
|
|
|
+ 'code'=>1,
|
|
|
+ 'msg'=>"success",
|
|
|
+ 'data'=>[
|
|
|
+ 'order_num_7'=>$order_num_7,
|
|
|
+ 'ts_7'=>$ts_7,
|
|
|
+ 'order_num_m'=>$order_num_m,
|
|
|
+ 'ts_m'=>$ts_m,
|
|
|
+ ]
|
|
|
+ ],JSON_UNESCAPED_UNICODE);
|
|
|
+ die;
|
|
|
+ }
|
|
|
+ //统计超7天未出货
|
|
|
+ private function _tj7daywck($table_name){
|
|
|
+ $day_7 = date("Y-m-d", strtotime("-6 days"));
|
|
|
+ $month_one = date("Y-m-d", strtotime("-1 month"));
|
|
|
+ $this->db->select("COUNT(*) as total_orders, SUM(ts) as total_products");
|
|
|
+ $this->db->where('library',1);//未出库
|
|
|
+ $this->db->where("print",3);//已打印
|
|
|
+ $this->db->where("type != ",'5');
|
|
|
+ $this->db->where_in('state',['207','208','209']);//允许发货的状态 代发货 部分发货 待揽收
|
|
|
+ $this->db->where("printtime <",strtotime($day_7));
|
|
|
+ $this->db->where("printtime >=",strtotime($month_one));
|
|
|
+ $r = $this->db->get($table_name)->row_array();
|
|
|
+ return $r;
|
|
|
+ }
|
|
|
+ //统计未发货单
|
|
|
+ private function _tjwfhd($table_name){
|
|
|
+ $month_one = date("Y-m-d", strtotime("-1 month"));
|
|
|
+ $this->db->select("COUNT(*) as total_orders, SUM(ts) as total_products");
|
|
|
+ $this->db->where('library',1);//未出库
|
|
|
+ $this->db->where("print",3);//已打印
|
|
|
+ $this->db->where("type != ",'5');
|
|
|
+ $this->db->where_in('state',['207','208','209']);//允许发货的状态 代发货 部分发货 待揽收
|
|
|
+ $this->db->where("printtime >=",strtotime($month_one));
|
|
|
+ $r = $this->db->get($table_name)->row_array();
|
|
|
+ return $r;
|
|
|
+ }
|
|
|
}
|