Procházet zdrojové kódy

Merge branch 'master-new' into master-new-dev-wf

wufeng před 1 rokem
rodič
revize
91eb121b61

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

@@ -288,7 +288,7 @@ class After extends Base
                     ->name('supplier')
                     ->where(['is_del' => 0, 'personid' => $arr])
                     ->column('code');
-                $where[] = ["a.supplierNo", "in", $supplierNos];//这个地方不应该使用condition,应该使用where与其他条件并列
+                $condition[] = ["a.supplierNo", "in", $supplierNos];//这个地方不应该使用condition,应该使用where与其他条件并列
             }
         }
 

+ 8 - 8
app/admin/controller/GoodOfflineLog.php

@@ -27,14 +27,14 @@ class GoodOfflineLog extends Base
 //        if (!empty($role[DataGroupModel::$type_全部])) $where[] = ["createrid", "in", $role[DataGroupModel::$type_全部]];
 
         //只有level2的账号过滤数据权限
-        if ($this->level == 2) {
-            $role = $this->checkDataShare();
-            $hand = resign_hand_user($this->uid, 0);
-            if (!empty($role[DataGroupModel::$type_全部])) {
-                $arr = array_unique(array_merge($hand, $role[DataGroupModel::$type_全部]));
-                $where[] = ['a.createrid', 'in', $arr];
-            }
-        }
+//        if ($this->level == 2) {
+//            $role = $this->checkDataShare();
+//            $hand = resign_hand_user($this->uid, 0);
+//            if (!empty($role[DataGroupModel::$type_全部])) {
+//                $arr = array_unique(array_merge($hand, $role[DataGroupModel::$type_全部]));
+//                $where[] = ['a.createrid', 'in', $arr];
+//            }
+//        }
 
         $count = Db::name('good_offline_log')
             ->alias("a")

+ 1 - 0
app/admin/controller/Goodup.php

@@ -2254,6 +2254,7 @@ class Goodup extends Base
         if (($this->level == 2) && ($supplierNo != $data['supplierNo'])) {
             $supplier_account = checkHasAccountBySupplierNos([$supplierNo]);
             if (isset($supplier_account[$supplierNo])) return json_show(1004, '该供应商已开通账号,不允许操作');
+            if (isset($supplier_account[$data['supplierNo']])) return json_show(1004, '原供应商已开通账号,不允许操作');
         }
 
         $userCommon= \app\admin\common\User::getIns();

+ 16 - 3
app/admin/controller/OrderOutChild.php

@@ -409,7 +409,7 @@ class OrderOutChild extends Base
 
         $order_out = Db::name('order_out')
             ->where(['is_del' => 0, 'outCode' => array_unique(array_column($child, 'outCode'))])
-            ->column('id,send_num,send_status,0 already_send_num,status,apply_id', 'outCode');
+            ->column('id,send_num,send_status,0 already_send_num,post_name,post_code,post_fee,status,apply_id', 'outCode');
 
         $sale = Db::name('sale')
             ->where(['is_del' => 0, 'orderCode' => array_unique(array_column($child, 'orderCode'))])
@@ -516,12 +516,25 @@ class OrderOutChild extends Base
                 ]);
 
                 $order_out[$child[$value['outChildCode']]['outCode']]['already_send_num'] += $child[$value['outChildCode']]['num'];
-
+                $order_out[$child[$value['outChildCode']]['outCode']]['already_send_num'] += $child[$value['outChildCode']]['num'];
+                $order_out[$child[$value['outChildCode']]['outCode']]['already_send_num'] += $child[$value['outChildCode']]['num'];
+				if($order_out[$child[$value['outChildCode']]['outCode']]['post_name']==''||$order_out[$child[$value['outChildCode']]['outCode']]['post_code']=='' ){
+					$order_out[$child[$value['outChildCode']]['outCode']]['post_name']=  $value['post_name'];
+					$order_out[$child[$value['outChildCode']]['outCode']]['post_code']=  $value['post_code'];
+					$order_out[$child[$value['outChildCode']]['outCode']]['post_fee']=  $value['post_fee'];
+				}
                 //发货单
                 //send_status 3部分发货,4全部发货
                 Db::name('order_out')
                     ->where(['id' => $order_out[$child[$value['outChildCode']]['outCode']]['id']])
-                    ->update(['send_status' => $order_out[$child[$value['outChildCode']]['outCode']]['already_send_num'] >= $order_out[$child[$value['outChildCode']]['outCode']]['send_num'] ? 4 : 3, 'status' => 2, 'updatetime' => $date]);
+                    ->update([
+                    	'send_status' => $order_out[$child[$value['outChildCode']]['outCode']]['already_send_num'] >= $order_out[$child[$value['outChildCode']]['outCode']]['send_num'] ? 4 : 3,
+                    	'status' => 2,
+                    	'post_name' => $order_out[$child[$value['outChildCode']]['outCode']]['post_name'],
+                        'post_code' => $order_out[$child[$value['outChildCode']]['outCode']]['post_code'],
+                        'post_fee' => $order_out[$child[$value['outChildCode']]['outCode']]['post_fee'],
+                    	'updatetime' => $date
+                    	 ]);
 
                 $sale[$child[$value['outChildCode']]['orderCode']]['send_num'] += $child[$value['outChildCode']]['num'];
                 $sale[$child[$value['outChildCode']]['orderCode']]['wsend_num'] -= $child[$value['outChildCode']]['num'];

+ 4 - 2
app/admin/controller/ReorderChild.php

@@ -137,8 +137,8 @@ class ReorderChild extends Base
                     "before_status" => 0,
                     'holder_id' => $this->uid
                 ]);
-
-                //维护发货工单
+				if(isset($value['outChildCode'])){
+					 //维护发货工单
                 $orderOutChild[$value['outChildCode']]['num'] -= $value['return_num'];
                 if ($orderOutChild[$value['outChildCode']]['num'] <= 0) {
                     $orderOutChild[$value['outChildCode']]['status'] = 4;
@@ -153,6 +153,8 @@ class ReorderChild extends Base
                         'status' => $orderOutChild[$value['outChildCode']]['status'],
                         'is_del' => $orderOutChild[$value['outChildCode']]['is_del'],
                     ]);
+				}
+
 
                 if ($param['outCode'] != '') {
                     //维护发货单

+ 1 - 1
app/common.php

@@ -122,7 +122,7 @@ if(!function_exists("GetFin")){
 	function GetFin($uri,$post){
 		$host =env("fin.hosturl");
 		$data =curl_request($host.$uri,$post);
-		return $data;
+		return json_decode($data,true);
 	}
 }