|
|
@@ -516,7 +516,57 @@ class Whlabelfz extends Start_Controller
|
|
|
|
|
|
private function _bqplindex(){
|
|
|
if($this->input->method() == 'post'){
|
|
|
- $rows = array('total'=>0,'over'=>1,'pagenum'=>1,'rows'=>([]));
|
|
|
+ $page = $this->input->post('page',true);
|
|
|
+ $perpage = $this->input->post('perpage',true);
|
|
|
+ $title = $this->input->post('title',true);
|
|
|
+ $sku = $this->input->post('sku',true);
|
|
|
+ $timetk = $this->input->post('timetk',true);
|
|
|
+ $timetj = $this->input->post('timetj',true);
|
|
|
+ $timetk = strtotime($timetk);
|
|
|
+ $timetj = strtotime($timetj);
|
|
|
+ $status = $this->input->post('status',true);
|
|
|
+
|
|
|
+ if($timetk && $timetj)
|
|
|
+ {
|
|
|
+ $where = " time > '$timetk' and time < '$timetj'";
|
|
|
+ }
|
|
|
+ if($title){
|
|
|
+ $where .= " and title like '%$title%'";
|
|
|
+ }
|
|
|
+ if($sku){
|
|
|
+ $where .= " and sku like '%$sku%'";
|
|
|
+ }
|
|
|
+ if($status > -1){
|
|
|
+ $where .= " and status = '$status'";
|
|
|
+ }
|
|
|
+ //数据排序
|
|
|
+ $order_str = "id asc";
|
|
|
+ if(empty($page))
|
|
|
+ {
|
|
|
+ $start = 0;
|
|
|
+ $perpage = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $start = ($page - 1)*$perpage;
|
|
|
+ }
|
|
|
+ $purchase_list = $this->purchase->find_all("1 = 1","id,title");
|
|
|
+ $purchase_list = array_column($purchase_list,'title','id');
|
|
|
+
|
|
|
+ //取得信息列表
|
|
|
+ $info_list = $this->whlabellabelprint->find_all($where,'id,purchase,sku,title,warehouse,details,dynum,status,time,print_time',$order_str,$start,$perpage);
|
|
|
+ foreach ($info_list as $key=>$value)
|
|
|
+ {
|
|
|
+ $info_list[$key]['purchase'] = isset($purchase_list[$value['purchase']])?$purchase_list[$value['purchase']]:'';
|
|
|
+ $info_list[$key]['warehouse'] = $this->_getWarehouseById($value['warehouse']);
|
|
|
+ $info_list[$key]['time'] = date('Y-m-d H:i:s', $value['time']);
|
|
|
+ $info_list[$key]['status'] = empty($value['status'])?'未打印':'已打印';
|
|
|
+ $info_list[$key]['print_time'] = empty($value['print_time'])? '': date('Y-m-d H:i:s', $value['print_time']);
|
|
|
+ }
|
|
|
+ $total = $this->whlabellabelprint->find_count($where);
|
|
|
+ $pagenum = ceil($total/$perpage);
|
|
|
+ $over = $total-($start+$perpage);
|
|
|
+ $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
|
|
|
echo json_encode($rows);exit;
|
|
|
}
|
|
|
$this->_Template('whlabelfz_bqpl', $this->data);
|
|
|
@@ -557,6 +607,20 @@ class Whlabelfz extends Start_Controller
|
|
|
return 13;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private function _getWarehouseById($str){
|
|
|
+ if($str == 12){
|
|
|
+ return '特殊库存仓';
|
|
|
+ }elseif($str == 5){
|
|
|
+ return '美国店';
|
|
|
+ }elseif($str == 16){
|
|
|
+ return '定制头套仓';
|
|
|
+ }elseif($str == 34){
|
|
|
+ return 'TikTok仓';
|
|
|
+ }else{
|
|
|
+ return '许昌仓';
|
|
|
+ }
|
|
|
+ }
|
|
|
private function _bqpladd(){
|
|
|
$params = $this->input->post('data',true);
|
|
|
$params = json_decode($params,true);
|