Commit 78ed6dfa by 杨树贤

转移日志

parent 2cb12144
......@@ -9,6 +9,7 @@ use App\Http\Services\LogService;
use App\Http\Services\SupplierContactService;
use App\Http\Transformers\SupplierContactTransformer;
use App\Http\Validators\SupplierContactValidator;
use App\Model\IntracodeModel;
use App\Model\LogModel;
use App\Model\SupplierChannelModel;
use App\Model\SupplierContactModel;
......@@ -213,6 +214,14 @@ class SupplierContactApiController extends Controller
'channel_uid' => implode(',', $channelUid),
]);
//打上日志
$contactList = SupplierContactModel::where('supplier_id', $supplierId)->where('can_check_uids', $originCanCheckUids)->get()->toArray();
$originName = (new AdminUserService())->getAdminUserNameByCodeId($originCanCheckUids);
$newName = (new AdminUserService())->getAdminUserNameByCodeId($newCanCheckUids);
foreach ($contactList as $contact) {
(new LogService())->AddLog($supplierId, LogModel::UPDATE_OPERATE, '转移供应商联系人', "供应商联系人 {$contact['supplier_consignee']}{$originName} 转移到 {$newName} ");
}
//最后直接去批量修改即可
return SupplierContactModel::where('supplier_id', $supplierId)->where('can_check_uids', $originCanCheckUids)
->update(['can_check_uids' => $newCanCheckUids]);
......
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