Browse Source

Merge branch 'version1.5' into dev_wf

wufeng 2 years ago
parent
commit
fefd7ffaac

+ 1 - 1
app/admin/controller/Activity.php

@@ -29,7 +29,7 @@ class Activity extends Base
         if($status!==""){
             $where[]=['ga.status',"=",$status];
         }
-        $activity_code = isset($this->post['activity_code']) && $this->post['activity_code'] !=="" ? intval($this->post['activity_code']):"";
+        $activity_code = isset($this->post['activity_code']) && $this->post['activity_code'] !=="" ? trim($this->post['activity_code']):"";
         if($activity_code!==""){
             $where[]=['ga.activity_code',"like","%$activity_code%"];
         }

+ 4 - 1
app/admin/controller/Sale.php

@@ -3056,7 +3056,8 @@ class Sale extends Base
         $condition='';
         if(!empty($role['write']) && $this->uid!=""){
             // $where[]=["a.apply_id","in",$role['write']];
-            $condition .="n.contactor = {$this->uid} or a.apply_id in (".implode(',',$role['write']).")";
+            $condition .=" (b.is_stock=1 and n.contactor = {$this->uid}) or (b.is_stock=0 and wpo.cgder_id = {$this->uid}) or a.apply_id in (".implode(',',
+                    $role['write']).")";
         }
 //        if(!empty($role['platform']) ){
 //            $where[]=["b.platform_id","in",$role['platform']];
@@ -3071,6 +3072,7 @@ class Sale extends Base
             ->join("warehouse_info n","n.wsm_code=a.wsm_code","left")
             ->leftJoin("depart_user u", "u.uid=a.apply_id AND u.is_del=0")
             ->leftJoin("order_send os","os.outCode=a.outCode")
+            ->leftJoin("purchease_order wpo","wpo.cgdNo=os.cgdNo")
             ->where($where)
             ->where($condition)
             ->count();
@@ -3082,6 +3084,7 @@ class Sale extends Base
             ->join("customer_info v", "v.companyNo=b.customer_code", "left")
             ->join("warehouse_info n","n.wsm_code=a.wsm_code","left")
             ->leftJoin("order_send os","os.outCode=a.outCode")
+            ->leftJoin("purchease_order wpo","wpo.cgdNo=os.cgdNo")
             ->leftJoin("depart_user u", "u.uid=a.apply_id AND u.is_del=0")
             ->field("a.*,b.good_name,b.good_code,b.skuCode,b.supplierNo,b.customer_code,v.companyName,b.origin_price,b.sale_price,b.total_price,os.cgdNo,u.itemid")
             ->where($where)

+ 3 - 3
app/command/NowReportHandle.php

@@ -28,7 +28,7 @@ class NowReportHandle extends Command
     {
 
         try {
-
+            ini_set("memory_limit","516M");
             $info = Cache::store('redis')->handler()->rpop($this->key);
             if ($info) {
 
@@ -256,13 +256,13 @@ class NowReportHandle extends Command
 	wpo.diff_weight '工差',
 	wpo.diff_fee '采购工差金额',
 	wpo.good_price '成本合计',
-	(wpo.gold_price * wtd.th_num) '退货采购货款',
+	(wpo.good_price * wtd.th_num) '退货采购货款',
 	'' as '税点',
 	wpo.supplier_name '供应商名称',
 	if(ws.is_stock=1,'是','否') '是否库存',
 	'' as '发货方式',
+	if(ifnull(wsr.is_th,wor.is_th)=0,'否',是) as '供应商是否同意退货',
 	if(wps.pay_type='0','现结',if(wps.pay_type='1','月结',if(wps.pay_type='2','双月结',wps.pay_type))) as '付款方式'
-	
 	")->cursor();
 
         $com = [];