Commit 46959db6 by mushishixian

渠道开发优化选择

parent 0eeccb97
......@@ -183,10 +183,7 @@ class SupplierController extends Controller
$supplier = $transformer->transformInfo($supplier);
$this->data['supplier'] = $supplier;
$intracodeModel = new IntracodeModel();
$adminUserService = new AdminUserService();
// $userCodes = $adminUserService->getPurchaseUserCodes();
$this->data['userCodes'] = $intracodeModel->getSampleEncode();
// $this->data['userCodes'] =$userCodes;
$this->data['userCodes'] = $intracodeModel->getPurchaseUserCodes();
$logModel = new LogModel();
$this->data['logs'] = $logModel->where('supplier_id', $supplierId)
->where('action', '分配渠道开发员')->orderBy('id', 'desc')
......
......@@ -63,13 +63,5 @@ class AdminUserService
return $users;
}
public function getPurchaseUserCodes()
{
$users = $this->getPurchaseUsers();
$userCodes = [];
foreach ($users as $user) {
$userCodes[$user['code_id']] = $user['name'];
}
return $userCodes;
}
}
\ No newline at end of file
......@@ -122,8 +122,6 @@ class SupplierService
$channel['update_time'] = time();
$model->where('supplier_id', $supplierId)->update($channel);
$this->saveSupplierCode($supplierId);
//不能直接插到数据库,要存到一个临时的地方,审核通过才写到数据库
$redis = $redis->hset("supplier_audit_list",$supplierId);
//插入系数到redis
$supplierAddressService = new SupplierAddressService();
$supplierAddressService->saveAddress($address);
......
......@@ -118,7 +118,7 @@ class SupplierTransformer
$log = $logModel->where('supplier_id', $supplier['supplier_id'])
->where('type', LogModel::UPDATE_OPERATE)->orderBy('id', 'desc')->first();
$supplier['last_update_name'] = $log['admin_name']?:'无';
$supplier['last_update_time'] = $supplier['last_update_time'] ? date('Y-m-d H:i:s', $log['add_time']) : '无';
$supplier['last_update_time'] = !empty($supplier['last_update_time']) ? date('Y-m-d H:i:s', $log['add_time']) : '无';
return $supplier;
}
......
......@@ -21,7 +21,7 @@ class SupplierValidator
'legal_representative' => 'required',
'register_company_name' => 'required',
'stockup_type' => 'required',
'supplier_group' => 'required',
// 'supplier_group' => 'required',
'region' => 'required',
'cn_delivery_time' => 'regex:/^\d+\-\d$/',
'us_delivery_time' => 'regex:/^\d+\-\d$/',
......
......@@ -2,6 +2,7 @@
namespace App\Model;
use App\Http\Services\AdminUserService;
use Illuminate\Database\Eloquent\Model;
class IntracodeModel extends Model
......@@ -73,4 +74,26 @@ class IntracodeModel extends Model
}
return $code;
}
//获取渠道开发那边的人员(还是会汇总所有的内部编码的,只是把运营他们那边的人员优先级提高一些)
public function getPurchaseUserCodes()
{
$adminService = new AdminUserService();
$users = $adminService->getPurchaseUsers();
$codeIds = array_column($users, 'code_id');
$codes = $this->getSampleEncode();
$userCodes = [];
foreach ($users as $user) {
$userCodes[$user['code_id']] = $user['name'];
}
$temp = [];
foreach ($codes as $code => $name) {
if (in_array($code,$codeIds)) {
unset($codes[$code]);
$temp[$code] = $name;
}
}
$userCodes = $temp + $codes;
return $userCodes;
}
}
......@@ -20,7 +20,7 @@
{{-- admin.putTempData('{{$supplier['supplier_code']}}', {{$supplier['update_time']}});--}}
{{--}--}}
index.setTabTitle('供应商详情 - {{$supplier['supplier_code'] or ''}}');
{{--index.setTabTitle('供应商详情 - {{$supplier['supplier_code'] or ''}}');--}}
function openLogView() {
// 打开右侧面板
......
......@@ -12,7 +12,7 @@
layer.load(1);
});
index.setTabTitle('供应商修改 - {{$supplier['supplier_code'] or ''}}');
{{--index.setTabTitle('供应商修改 - {{$supplier['supplier_code'] or ''}}');--}}
form.on('submit(updateSupplier)', function (data) {
let confirmMessage = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment