Commit 5817e308 by 杨树贤

修改sku采购员同步修改采集供应商的采购员

parent 8cf49a4b
......@@ -555,6 +555,7 @@ class SupplierApiController extends Controller
$this->response(-1, '选择的供应商里面不存在对应的线上采购员');
}
$supplierService->batchAllocateYunxinChannelUser($supplierIds, $channelUid);
dd(1223);
$this->response(0, '批量分配线上采购员成功');
}
......
......@@ -6,6 +6,7 @@ namespace App\Http\Services;
use App\Http\Controllers\Filter\SupplierFilter;
use App\Http\Transformers\SupplierTransformer;
use App\Http\Validators\SupplierValidator;
use App\Model\BigData\DataManageModel;
use App\Model\LogModel;
use App\Model\RedisModel;
use App\Model\SupplierAccountModel;
......@@ -59,7 +60,6 @@ class SupplierService
}
public function saveSupplier($channel)
{
$supplierTransformer = new SupplierTransformer();
......@@ -493,14 +493,21 @@ class SupplierService
$logService = new LogService();
$redis = new RedisModel();
foreach ($supplierIds as $supplierId) {
$preYunxinChannelUid = SupplierChannelModel::where('supplier_id', $supplierId)->value('yunxin_channel_uid');
$supplier = SupplierChannelModel::where('supplier_id', $supplierId)->select(['supplier_code', 'yunxin_channel_uid'])
->first()->toArray();
$preYunxinChannelUid = $supplier['yunxin_channel_uid'];
SupplierChannelModel::where('supplier_id', $supplierId)->update([
'yunxin_channel_uid' => $yunxinChannelUid
]);
//去查找数据对接系统是否有这个供应商,有的话,把采购员也改成这个
DataManageModel::where('canal', $supplier['supplier_code'])->update([
'pur_uid' => $yunxinChannelUid,
'update_time' => time(),
]);
$supplier = SupplierChannelModel::where('supplier_id', $supplierId)->first()->toArray();
//还要丢队列给批量修改sku的内部编码
$redisKey = 'lie_supplier_change_yunxin_user_' . $supplierId;
if (!$redis->get($redisKey)) {
if ($redis->get($redisKey)) {
$data = [
'canal' => $supplier['supplier_code'],
"encoded" => $yunxinChannelUid,
......
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