Kaynağa Gözat

添加boss_qt仓库筛选

lvhao 6 ay önce
ebeveyn
işleme
f7e185109c
2 değiştirilmiş dosya ile 23 ekleme ve 3 silme
  1. 15 3
      core/CoreApp/controllers/Boss.php
  2. 8 0
      template/erp/boss_qt.html

+ 15 - 3
core/CoreApp/controllers/Boss.php

@@ -125,6 +125,10 @@ class Boss extends Start_Controller {
 		$this->data['excelusernum'] = $setting['excelusernum'];
 		$this->data['exceljmnum'] = $setting['exceljmnum'];
 		$this->data['sctime'] = $setting['sctime'];
+	
+		$wh = $this->warehouse->find_all('1=1','id,title');
+		
+		$this->data['wh'] = $wh;
         $this->_Template('boss_qt',$this->data);
 	}
 	public function _out($arg_array)
@@ -1064,10 +1068,14 @@ class Boss extends Start_Controller {
 			$category = $this->input->get('category',true);
 			$shop = $this->input->get('shop',true);
 			$density = $this->input->get('density',true);
+			$warehouse = $this->input->get('warehouse',true);
 			$time = $this->input->get('time',true);
 			$timetk = strtotime($timetk);
 			$timetj = strtotime($timetj);
 			$where = "";
+			if($warehouse){
+				$where .= " type = ".$warehouse." ";
+			}
 			if($category)
             {
                 $where  .= "fpdata like '%-".$category."-%' and ";
@@ -1104,11 +1112,13 @@ class Boss extends Start_Controller {
             {
                 $where  .= "fpdata like '%-".$lacetype."-%' and ";
             }
-			$dataa = $this->fullorder->find_all($where.$time." > '$timetk' and ".$time." < '$timetj'",'fpdata,number,whlabel','id desc');
-		 	$datab = $this->fullordersmt->find_all($where.$time." > '$timetk' and ".$time." < '$timetj' and shop != '9'",'fpdata,number,whlabel','id desc');
-			$datac = $this->fullordertt->find_all($where.$time." > '$timetk' and ".$time." < '$timetj'",'fpdata,number,whlabel','id desc');
+			$dataa = $this->fullorder->find_all($where.$time." > '$timetk' and ".$time." < '$timetj'",'fpdata,number,whlabel,type','id desc');
+		 	$datab = $this->fullordersmt->find_all($where.$time." > '$timetk' and ".$time." < '$timetj' and shop != '9'",'fpdata,number,whlabel,type','id desc');
+			$datac = $this->fullordertt->find_all($where.$time." > '$timetk' and ".$time." < '$timetj'",'fpdata,number,whlabel,type','id desc');
 			$data = array_merge($dataa,$datab,$datac);
 			$sp = array();$cs = array();
+			$warehouses = $this->warehouse->find_all('1=1','id,title');
+	        $warehouses = array_column($warehouses,'title','id');
 			foreach ($data as $val) 
 			{
 				$f = explode(';',trim($val['fpdata'],';'));
@@ -1228,6 +1238,7 @@ class Boss extends Start_Controller {
 						$whs = (isset($wsku[0]['sku']))?$wsku[0]['sku']:'';
 						$sp[$title[1]] = array('t'=>$title[1],'z'=>$zh,'w'=>$whs,'j'=>$jm,'n'=>$title[2]);
 					}
+					$sp[$title[1]]['warehouse'] = isset($warehouses[$val['type']])?$warehouses[$val['type']]:'仓库异常';
 				}
 			}
 			$sp = array_values($sp);
@@ -1239,6 +1250,7 @@ class Boss extends Start_Controller {
 			<td>SKU</td>
 			<td>用友料号</td>
             <td>数量</td>
+			<td>仓库</td>
             </tr>
             </table>"; 
             $filename = $title.".xls"; 

+ 8 - 0
template/erp/boss_qt.html

@@ -73,6 +73,14 @@
 {/loop}
 </select>
 </li>
+<li>
+仓库:<select name="warehouse" class="select">
+<option value="">请选择</option>
+{loop $wh as  $val} <!-- 这个是不显示部分曲度 -->
+<option value="{$val['id']}">{$val['title']}</option>
+{/loop}
+</select>
+</li>
 <li><select name="time" class="select">
 <option value="librarytime">出库时间</option>
 <option value="dtime">订单时间</option>