|
|
@@ -83,6 +83,9 @@ class Zzququeu9 extends Start_Controller {
|
|
|
}elseif($arg == 'cpkbh_index'){
|
|
|
$this->_cpkbh_index();
|
|
|
}
|
|
|
+ elseif($arg == 'excelwx'){
|
|
|
+ $this->_excelwx();
|
|
|
+ }
|
|
|
elseif($arg == 'checkProduct'){
|
|
|
$this->_checkProduct();
|
|
|
}
|
|
|
@@ -1512,5 +1515,82 @@ class Zzququeu9 extends Start_Controller {
|
|
|
echo json_encode(array('msg'=>$res['msg'],'success'=>false,'data'=>[]));
|
|
|
exit;
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ //导出excel
|
|
|
+ protected function _excelwx(){
|
|
|
+ $params = $this->input->post(null, TRUE);
|
|
|
+ if(empty($params)){
|
|
|
+ echo json_encode(array('msg'=>'参数错误','success'=>false));
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ $timetk = $this->input->post('timetk',true);//订单开始时间
|
|
|
+ $timetj = $this->input->post('timetj',true);//订单结束时间
|
|
|
+ $timetk = strtotime($timetk);
|
|
|
+ $timetj = strtotime($timetj);
|
|
|
+ $order_no = $this->input->post('order_no',true);
|
|
|
+ $where = " ( type = 20) ";
|
|
|
+ if($order_no){
|
|
|
+ $where .= " and order_no like '%".$order_no."%' ";
|
|
|
+ }
|
|
|
+ if($timetk && $timetj){
|
|
|
+ $where .= " and create_time > ".$timetk." and create_time < ".$timetj." ";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ $info_list = $this->zzquque_u9->find_all($where,'*','id desc');
|
|
|
+ $list = [];
|
|
|
+ $lb_list= [];
|
|
|
+ foreach($info_list as $k=>$v){
|
|
|
+ $bzsh_no = $v['bzsh_no'];
|
|
|
+ $xs_no = empty($v['xs_no'])?"":$v['xs_no'];
|
|
|
+ $bzch_no = empty($v['bzch_no'])?"":$v['bzch_no'];
|
|
|
+ $lb_list[] = $v['child_order_no'];
|
|
|
+ $list[] = [
|
|
|
+ 'id'=>$v['id'],
|
|
|
+ 'order_no'=>$v['order_no'],
|
|
|
+ 'type'=>"工厂外销单",
|
|
|
+ 'child_order_no'=>$v['child_order_no'],
|
|
|
+ 'bzsh_no'=> $bzsh_no,
|
|
|
+ 'xs_no'=>$xs_no,
|
|
|
+ 'bzch_no'=>$bzch_no,
|
|
|
+ 'create_time'=>date("Y-m-d H:i:s",$v['create_time']),
|
|
|
+ 'update_time'=>date("Y-m-d H:i:s",$v['update_time'])
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $lb_list = array_unique($lb_list);
|
|
|
+ $lb_arr = [];
|
|
|
+ if(!empty($lb_list)){
|
|
|
+ $lb_arr = $this->systemtransfer->find_all("id in (".implode(',',$lb_list).") ","id,jm,title,pm");
|
|
|
+ $lb_arr = array_column($lb_arr,null,'id');
|
|
|
+ }
|
|
|
+ foreach($list as $k=>$v){
|
|
|
+ $list[$k]['child_order_no'] = isset($lb_arr[$v['child_order_no']])?$lb_arr[$v['child_order_no']]['pm']:'';
|
|
|
+ }
|
|
|
+ $final_list = [];
|
|
|
+ foreach($list as $k=>$v){
|
|
|
+ $final_list[] = [
|
|
|
+ "订单号"=>$v['order_no'],
|
|
|
+ "类型"=>$v['type'],
|
|
|
+ "成品入库单号"=>$v['bzsh_no'],
|
|
|
+ "销售单号"=>$v['xs_no'],
|
|
|
+ "标准出货单号"=>$v['bzch_no'],
|
|
|
+ "创建时间"=>$v['create_time'],
|
|
|
+ "更新时间"=>$v['update_time'],
|
|
|
+ "品名"=>$v['child_order_no'],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if(empty($list)){
|
|
|
+ echo json_encode(array('msg'=>'没有数据','success'=>false));
|
|
|
+ exit;
|
|
|
+ }else{
|
|
|
+ echo json_encode(array('msg'=>'获取成功','success'=>true,'data'=>$final_list));
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|