Browse Source

Merge branch 'version1.5' into dev_wf

wufeng 2 years ago
parent
commit
035088f18c
3 changed files with 15 additions and 8 deletions
  1. 2 0
      app/admin/controller/Resigninfo.php
  2. 12 7
      app/admin/controller/Sale.php
  3. 1 1
      app/common.php

+ 2 - 0
app/admin/controller/Resigninfo.php

@@ -125,6 +125,8 @@ class Resigninfo extends Base
             "resign_date"=> $resign_date,
             "expire_date"=>$expire_date,
             "is_hand"=>$is_hand,
+            "apply_id"=>$this->uid,
+            "apply_name"=>$this->uname,
             "status"=>$status,
             "remark"=>$remark,
             "is_del"=>0,

+ 12 - 7
app/admin/controller/Sale.php

@@ -3509,22 +3509,24 @@ class Sale extends Base
 
 
         $hand = resign_hand_user($this->uid,0);
+        $uidarr =implode(",",$hand);
         //库管只能看到库存品订单,供应商负责人只能看到非库存品订单
         if(!in_array($this->roleid,[1,33])){
             //库管看到所有的库存品发货申请单
-            if(in_array($this->roleid,config('app.wsm_cgder_role'))) $where[]=["b.is_stock","=",1];
+            if(in_array($this->roleid,config('app.wsm_cgder_role'))) $condition .= " b.is_stock=1";
             else{
             	$role = $this->checkDataShare();
-            	$uidarr =implode(",",$hand);
                 if (!empty($role[DataGroupModel::$type_全部])) {
                 	$arr= array_unique(array_merge($hand,$role[DataGroupModel::$type_全部]));
+                   if($condition!='') $condition.=" or ";
                 	$condition .= " a.apply_id in (" . implode(',',$arr) . ")";
                 }
-
-                $personid=Db::name('supplier')->field('id')->where(['is_del'=>0,'personid'=> $hand])->findOrEmpty();
-                if($personid)$condition.=" or (b.is_stock=0 and sip.personid in ($uidarr))";//供应商负责人能看到非库存品的单子
-//                else $condition.="a.apply_id = {$this->uid}";//其他只能看到自己创建的单子
             }
+             $personid=Db::name('supplier')->field('id')->where(['is_del'=>0,'personid'=> $hand])->findOrEmpty();
+                if($personid){
+                	 if($condition!='') $condition.=" or ";
+                	 $condition.="(b.is_stock=0 and sip.personid in ($uidarr))";
+                }
         }
 //        if(!empty($role['platform']) ){
 //            $where[]=["b.platform_id","in",$role['platform']];
@@ -3959,6 +3961,9 @@ class Sale extends Base
         if ($outinfo == false) {
             return error_show(1004, "发货数据未找到");
         }
+        if($outinfo['status']!=1){
+        	return error_show(1004, "发货状态有误");
+        }
         $einfo = Db::name('sale')->where(['orderCode' => $outinfo['orderCode'], 'is_del' => 0])->find();
         if (empty($einfo)) {
             return error_show(1002, "未找到销售订单数据");
@@ -3990,7 +3995,7 @@ class Sale extends Base
         }
         Db::startTrans();
         try {
-            $up = Db::name("order_out")->save($outinfo);
+            $up = Db::name("order_out")->where(["outCode"=>$outCode,"status"=>1,"is_del"=>0])->update($outinfo);
 
             $user_info = GetUserInfo($this->post['token']);
             $uid = isset($user_info['data']['id']) ? $user_info['data']['id'] : 0;

+ 1 - 1
app/common.php

@@ -1456,7 +1456,7 @@ if (!function_exists('check_activity')) {
             if ($act['activity_stock'] < $good_num) return [];//throw new \think\Exception('商品活动库存剩余' . $act['activity_stock']);
             if ($price < $act['activity_price']) throw new \think\Exception('售价低于活动价' . $act['activity_price']);
 
-            $merge= $act['is_activity'] == 1 ? ['final_price' => $act['activity_price']] : ['final_price' => $act['settle_price']];
+            $merge= $act['is_activity'] == 0 ? ['final_price' => $act['activity_price']] : ['final_price' => $act['settle_price']];
             return array_merge($act,$merge);
         }
     }