Ver código fonte

提交修改

lvhao 1 dia atrás
pai
commit
b7bda1e99f
1 arquivos alterados com 27 adições e 12 exclusões
  1. 27 12
      core/CoreApp/controllers/Whlabel_bh.php

+ 27 - 12
core/CoreApp/controllers/Whlabel_bh.php

@@ -2298,21 +2298,36 @@ class Whlabel_bh extends Start_Controller {
 		}
 		$start_time = strtotime(date('Y-m-d')) -  14* 24 * 60 * 60;
 		$end_time = strtotime(date('Y-m-d')) + 24 * 60 * 60;
-		//$all_list = $this->whlabel_bh->find_all("extra_type = 1 and time >= ".$start_time." and time <= ".$end_time);
+		//
 		$tmp_list = $this->whlabel_bh->find_pc("extra_type = 1 and time >= ".$start_time." and time <= ".$end_time,'orderinfo',"id,orderinfo,jgtime",'id desc');
-		var_dump($tmp_list);
-		die;
-		$orderinfo_list =[];
-		$total_num = 0;
-		foreach($all_list as $k=>$v){
-			$orderinfo_list[$v['id']] = $v['id'];
-			$total_num += $v['bhnum'];
-		}
-		$wbids = array_values($orderinfo_list);
-		if(empty($wbids)){
+		if(empty($tmp_list)){
+			$total_num = 0;
 			$over_num = 0;
 		}else{
-			$over_num = $this->whlabel_bh_transfer->find_count(" status = 2 and wbid in (".implode(",",$wbids).")");
+			$tmp_where = " ";
+			if(count($tmp_list) == 1){
+				$tmp_where = "orderinfo = '".$tmp_list[0]['orderinfo']."'";
+			}else{
+				foreach($tmp_list as $k=>$v){
+					$tmp_where .= " orderinfo = '".$v['orderinfo']."' or";
+				}
+				$tmp_where = rtrim($tmp_where,"or");
+			}
+
+			$all_list = $this->whlabel_bh->find_all($tmp_where);
+			$orderinfo_list =[];
+			$total_num = 0;
+			foreach($all_list as $k=>$v){
+				$orderinfo_list[$v['id']] = $v['id'];
+				$total_num += $v['bhnum'];
+			}
+			$wbids = array_values($orderinfo_list);
+			if(empty($wbids)){
+				$over_num = 0;
+			}else{
+				$over_num = $this->whlabel_bh_transfer->find_count(" status = 2 and wbid in (".implode(",",$wbids).")");
+			}
+			
 		}