Browse Source

修改高级其它的下载

lvhao 2 weeks ago
parent
commit
2a793d265b
2 changed files with 59 additions and 4 deletions
  1. 52 4
      core/CoreApp/controllers/Boss.php
  2. 7 0
      template/erp/boss_qt.html

+ 52 - 4
core/CoreApp/controllers/Boss.php

@@ -2146,6 +2146,7 @@ class Boss extends Start_Controller
 			$timetj = $this->input->get('timetj', true);
 			$timetk = strtotime($timetk);
 			$timetj = strtotime($timetj);
+			$source = $this->input->get('source', true);
 			if ($s) {
 				$shop = $this->shop->find_all("id = '$shop'");
 			} else {
@@ -2158,15 +2159,62 @@ class Boss extends Start_Controller
 			if ($n < 1) {
 				$n = 1;
 			}
+			// for ($i = 1; $i < $n; $i++) {
+			// 	$t = $j - ($n * 24 * 60 * 60) + ($i * 24 * 60 * 60);
+			// 	foreach ($shop as $val) {
+			// 		$data = $this->fullorder->find_all("$time > '$t' and $time < '" . ($t + 24 * 3600) . "' and shop = '" . $val['id'] . "'");
+			// 		$dd = 0;
+			// 		$m = 0;
+			// 		$d[] = array(date('Y-m-d', $t), $val['shopname'], count($data), sprintf("%01.2f", array_sum(array_column($data, 'shouldmoney'))));
+			// 	}
+			// }
+
 			for ($i = 1; $i < $n; $i++) {
 				$t = $j - ($n * 24 * 60 * 60) + ($i * 24 * 60 * 60);
+
+				$where = "$time > '$t' and $time < '" . ($t + 24 * 3600) . "' and shop = '" . $val['id'] . "'";
+				if($source == '2d'){
+					$where.= "  and source > 2  ";
+				}
+				if($source == '1'){
+					$where.= "  and source = 1  ";
+				}
 				foreach ($shop as $val) {
-					$data = $this->fullorder->find_all("$time > '$t' and $time < '" . ($t + 24 * 3600) . "' and shop = '" . $val['id'] . "'");
-					$dd = 0;
-					$m = 0;
-					$d[] = array(date('Y-m-d', $t), $val['shopname'], count($data), sprintf("%01.2f", array_sum(array_column($data, 'shouldmoney'))));
+					if($val['type'] == 269){
+						$data = $this->fullorder->find_all($where);
+						$dd = 0;
+						$m = 0;
+						$d[] = array(date('Y-m-d', $t), $val['shopname'], count($data), sprintf("%01.2f", array_sum(array_column($data, 'shouldmoney'))));
+					}else if($val['type'] == 270){
+						$data = $this->fullordersmt->find_all($where);
+						$dd = 0;
+						$m = 0;
+						$d[] = array(date('Y-m-d', $t), $val['shopname'], count($data), sprintf("%01.2f", array_sum(array_column($data, 'shouldmoney'))));
+
+
+					}else if($val['type'] == 1513){
+
+						$data = $this->fullorderamz->find_all($where);
+						$dd = 0;
+						$m = 0;
+						$d[] = array(date('Y-m-d', $t), $val['shopname'], count($data), sprintf("%01.2f", array_sum(array_column($data, 'shouldmoney'))));
+
+						
+					}else if($val['type'] == 1514){
+						$data = $this->fullordertt->find_all($where);
+						$dd = 0;
+						$m = 0;
+						$d[] = array(date('Y-m-d', $t), $val['shopname'], count($data), sprintf("%01.2f", array_sum(array_column($data, 'shouldmoney'))));
+
+
+					}
+					
+					
 				}
 			}
+
+
+
 			$title = "店铺数据统计" . date('Y-m-d H-i-s', time());
 			$titlename = "<table border=1>
             <tr>

+ 7 - 0
template/erp/boss_qt.html

@@ -116,6 +116,13 @@
 {/loop}</select>
 </select>
 </li>
+<li>
+    订单类型: <select name="source"  class="select" >
+        <option value="">全部</option>
+        <option value="1">线下订单</option>
+        <option value="2d">店内订单</option>
+    </select>
+ </li>
 <li><select name="time" class="select">
 <option value="dtime">订单时间</option>
 </select> :<input id="outk"  value="{date('Y-m-d',time()-24*3600)} 0:00" name="timetk" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})" readonly>