|
|
@@ -47,6 +47,8 @@ class Whlabelfz extends Start_Controller
|
|
|
$this->_printing();
|
|
|
}elseif($arg == 'whlabelscan'){
|
|
|
$this->_whlabelscan();
|
|
|
+ }elseif($arg == 'whlabelscanlogexcel'){
|
|
|
+ $this->_whlabelscanlogexcel();
|
|
|
}
|
|
|
else {
|
|
|
$this->_index();
|
|
|
@@ -924,9 +926,9 @@ class Whlabelfz extends Start_Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // private function _bqplprint(){
|
|
|
+ private function _bqplprint(){
|
|
|
|
|
|
- // }
|
|
|
+ }
|
|
|
|
|
|
private function _whlabelscan(){
|
|
|
if($this->input->method() == 'post'){
|
|
|
@@ -939,9 +941,10 @@ class Whlabelfz extends Start_Controller
|
|
|
$timetj = $this->input->post('timetj',true);
|
|
|
$timetk = strtotime($timetk);
|
|
|
$timetj = strtotime($timetj);
|
|
|
+ $where = "";
|
|
|
if($timetk && $timetj)
|
|
|
{
|
|
|
- $where = " addtime > '$timetk' and addtime < '$timetj'";
|
|
|
+ $where .= " addtime > '$timetk' and addtime < '$timetj'";
|
|
|
}
|
|
|
if($type){
|
|
|
$where .= " and type = '$type'";
|
|
|
@@ -988,4 +991,51 @@ class Whlabelfz extends Start_Controller
|
|
|
$this->_Template('whlabelfz_whlabelscan', $this->data);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private function _whlabelscanlogexcel(){
|
|
|
+ $title = $this->input->post('title',true);
|
|
|
+ $sku = $this->input->post('sku',true);
|
|
|
+ $type = $this->input->post('type',true);
|
|
|
+ $timetk = $this->input->post('timetk',true);
|
|
|
+ $timetj = $this->input->post('timetj',true);
|
|
|
+ $timetk = strtotime($timetk);
|
|
|
+ $timetj = strtotime($timetj);
|
|
|
+ $where = "";
|
|
|
+ if($timetk && $timetj)
|
|
|
+ {
|
|
|
+ $where .= " addtime > '$timetk' and addtime < '$timetj'";
|
|
|
+ }
|
|
|
+ if($type){
|
|
|
+ $where .= " and type = '$type'";
|
|
|
+ }
|
|
|
+ if($title){
|
|
|
+ $where .= " and title like '%$title%'";
|
|
|
+ }
|
|
|
+ if($sku){
|
|
|
+ $where .= " and sku like '%$sku%'";
|
|
|
+ }
|
|
|
+ $info_list = $this->whlabelscanlog->find_all($where,'sku,title,warehouse,type,num,addtime');
|
|
|
+ foreach ($info_list as $key=>$value)
|
|
|
+ {
|
|
|
+ $info_list[$key]['warehouse'] = $this->_getWarehouseById($value['warehouse']);
|
|
|
+ $info_list[$key]['type'] = $value['type'] == 1 ? '扫描入库' : '扫描出库';
|
|
|
+ $info_list[$key]['addtime'] = date('Y-m-d H:i:s', $value['addtime']);
|
|
|
+ }
|
|
|
+ if(empty($info_list)){
|
|
|
+ echo json_encode(array('msg'=>'没有数据','success'=>false));exit;
|
|
|
+ }
|
|
|
+ $final_list = [];
|
|
|
+ foreach ($info_list as $key => $value) {
|
|
|
+ $final_list[] = [
|
|
|
+ "SKU"=>$value['sku'],
|
|
|
+ "商品名称"=>$value['title'],
|
|
|
+ "仓库"=>$value['warehouse'],
|
|
|
+ "类型"=>$value['type'],
|
|
|
+ "数量"=>$value['num'],
|
|
|
+ "扫描时间"=> $value['addtime']
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $filename = "扫描日志_".date("Ymd")."_".rand(1000,9999).".xls";
|
|
|
+ echo json_encode(array('msg'=>'获取数据成功','success'=>true,'data'=>$final_list,'filename'=>$filename));exit;
|
|
|
+ }
|
|
|
}
|