wugg 2 years ago
parent
commit
5c31d13c22
2 changed files with 6 additions and 6 deletions
  1. 1 1
      app/admin/controller/User.php
  2. 5 5
      app/command/handleCxData.php

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

@@ -19,7 +19,7 @@ class User extends BaseController{
     		'companyArr|业务公司' => 'require|array',
             ]);
 
-        	if($valide->check($post)==false) return json_show(1004,$valide->getError());
+        	if($valide->check($post)==false) return error_show(1004,$valide->getError());
         	$isSuper = Db::name("user_role")->alias("a")
 	        ->leftJoin("role b","a.roleid=b.id")
 	        ->where(["a.uid"=>$post['id'],"a.is_del"=>0,"b.level"=>1])

+ 5 - 5
app/command/handleCxData.php

@@ -58,7 +58,7 @@ class handleCxData extends command
 	                    ->field('id,status')->findOrEmpty();
 	                    $all_branch = Db::name('customer_info')
 	                    ->whereIn('companyNo', $data['customer_code'])
-	                    ->column('branch', 'companyNo');
+	                    ->column('branch,parent', 'companyNo');
                         //已存在
                         if (!empty($exists_qrd)) {
                             if ($exists_qrd['status'] == 0) {
@@ -133,8 +133,8 @@ class handleCxData extends command
                                         'diff_weight' => $data['diff_weight'],//工差重量,
                                         'diff_fee' => $data['diff_fee'],//工差金额,
                                         'area' => $data['customer_name'],//公司,
-                                        'customerAttr' => $data['platform_id'],//客户属性,
-                                        'branch' => $all_branch[$data['customer_code']] ?? '',//分公司,从客户表中查
+                                        'customerAttr' =>$all_branch[$data['customer_code']]['parent'] ?? '',//客户属性,
+                                        'branch' => $all_branch[$data['customer_code']]['branch'] ?? '',//分公司,从客户表中查
                                         'cgdNo' => $data['cgdNo'],//采购单号,
                                         'thNum' => $data['th_num'],//退货数量,
                                         'th_fee' => $data['th_fee'],//退货金额,
@@ -218,8 +218,8 @@ class handleCxData extends command
                                 'diff_weight' => $data['diff_weight'],//工差重量,
                                 'diff_fee' => $data['diff_fee'],//工差金额,
                                 'area' => $data['customer_name'],//公司,
-                                'customerAttr' => $data['platform_id'],//客户属性,
-                                'branch' => $all_branch[$data['customer_code']] ?? '',//分公司,从客户表中查
+                                'customerAttr' => $all_branch[$data['customer_code']]['parent'],//客户属性,
+                                'branch' => $all_branch[$data['customer_code']]['branch'] ?? '',//分公司,从客户表中查
                                 'cgdNo' => $data['cgdNo'],//采购单号,
                                 'thNum' => $data['th_num'],//退货数量,
                                 'th_fee' => $data['th_fee'],//退货金额,