|
@@ -43,6 +43,10 @@ class Colour extends Start_Controller {
|
|
|
else if($arg == 'seebynumber'){
|
|
else if($arg == 'seebynumber'){
|
|
|
$this->_seebynumber($arg_array);
|
|
$this->_seebynumber($arg_array);
|
|
|
}
|
|
}
|
|
|
|
|
+ else if($arg == 'dcsptlist')
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->_dcsptlist();
|
|
|
|
|
+ }
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
$this->_index();
|
|
$this->_index();
|
|
@@ -599,4 +603,84 @@ class Colour extends Start_Controller {
|
|
|
$this->data['is_has'] = 1;
|
|
$this->data['is_has'] = 1;
|
|
|
$this->_Template('colour_see',$this->data);
|
|
$this->_Template('colour_see',$this->data);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private function _dcsptlist(){
|
|
|
|
|
+ if(isset($_SESSION['api']))
|
|
|
|
|
+ {
|
|
|
|
|
+ $user = $this->user->get_api($_SESSION['api']);
|
|
|
|
|
+ $usp = $user;
|
|
|
|
|
+ $fgshop = "";$sid = "";
|
|
|
|
|
+ $usersp = explode('|',trim($user['shop'],'|'));
|
|
|
|
|
+ foreach ($usersp as $value)
|
|
|
|
|
+ {
|
|
|
|
|
+ $fgshop .= " shop = ".$value." or";
|
|
|
|
|
+ $sid .= " id = ".$value." or";
|
|
|
|
|
+ }
|
|
|
|
|
+ $fgshop .= " shop = '0' or";
|
|
|
|
|
+ }
|
|
|
|
|
+ if($this->input->method() === 'post'){
|
|
|
|
|
+ $page = $this->input->post('page',true);
|
|
|
|
|
+ $perpage = $this->input->post('perpage',true);
|
|
|
|
|
+ $number = $this->input->post('number',true);
|
|
|
|
|
+ $shop = $this->input->post('shop',true);
|
|
|
|
|
+ $warehouse = $this->input->post('warehouse',true);
|
|
|
|
|
+ $timetk = $this->input->post('timetk',true);
|
|
|
|
|
+ $timetj = $this->input->post('timetj',true);
|
|
|
|
|
+ $timetk = strtotime($timetk);
|
|
|
|
|
+ $timetj = strtotime($timetj);
|
|
|
|
|
+ $where = " is_overimg = 0 and (".rtrim($fgshop,'or').")";
|
|
|
|
|
+ if($number)
|
|
|
|
|
+ {
|
|
|
|
|
+ $where .= " and number like '%$number%'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if($shop)
|
|
|
|
|
+ {
|
|
|
|
|
+ $where .= " and shop = '$shop'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if($warehouse)
|
|
|
|
|
+ {
|
|
|
|
|
+ $where .= " and warehouse = '$warehouse'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if($timetk && $timetj)
|
|
|
|
|
+ {
|
|
|
|
|
+ $where .= " and time > '$timetk' and time < '$timetj'";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //数据排序
|
|
|
|
|
+ $order_str = "id desc";
|
|
|
|
|
+ if(empty($page))
|
|
|
|
|
+ {
|
|
|
|
|
+ $start = 0;
|
|
|
|
|
+ $perpage = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ $start = ($page - 1)*$perpage;
|
|
|
|
|
+ }
|
|
|
|
|
+ $info_list = $this->colour->find_all($where,'id,number,shop,warehouse,time,library_time',$order_str,$start,$perpage);
|
|
|
|
|
+ foreach ($info_list as $key=>$value)
|
|
|
|
|
+ {
|
|
|
|
|
+ $info_list[$key]['time'] = date('Y-m-d H:i:s',$value['time']);
|
|
|
|
|
+ if($value['shop'] == '0')
|
|
|
|
|
+ {
|
|
|
|
|
+ $info_list[$key]['shop'] = '常用色';
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ $shop = $this->shop->read($value['shop']);
|
|
|
|
|
+ $info_list[$key]['shop'] = $shop['shopname'];
|
|
|
|
|
+ }
|
|
|
|
|
+ $warehouse = $this->warehouse->read($value['warehouse']);
|
|
|
|
|
+ $info_list[$key]['warehouse'] = $warehouse['title'];
|
|
|
|
|
+ $info_list[$key]['library_time'] = empty($value['library_time'])?'未出库': date('Y-m-d H:i',$value['library_time'])."出库";
|
|
|
|
|
+ }
|
|
|
|
|
+ $total = $this->colour->find_count($where);
|
|
|
|
|
+ $pagenum = ceil($total/$perpage);
|
|
|
|
|
+ $over = $total-($start+$perpage);
|
|
|
|
|
+ $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list),'cs'=>$fgshop);
|
|
|
|
|
+ echo json_encode($rows);exit;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $this->_Template('colour_dcsptlist',$this->data);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|