直连订单根据抖音账号优先分配

This commit is contained in:
jianghanbo 2024-12-16 18:09:11 +08:00
parent 15aff2849e
commit b3c91832c6
9 changed files with 36 additions and 15 deletions

View File

@ -223,13 +223,13 @@
>
</el-switch>
</el-form-item>
<!-- <el-form-item label="产品ID">
<el-input v-model="item.product_ids" type="textarea" />
<span style="color: red; font-size: 11px"
>多个用英文逗号隔开例如: 384731,2328</span
>
</el-form-item> -->
<el-form-item label="抖音昵称">
<el-input
v-model="item.dy_nickname"
name="dy_nickname"
placeholder="抖音昵称"
></el-input>
</el-form-item>
<el-form-item label="线路">
<el-select
filterable

View File

@ -129,6 +129,7 @@ class AdminController extends base
$item->type = $type;
$item->wechat = $request->post('wechat','');
$item->wechat_pic = $request->post('wechat_pic','');
$item->dy_nickname = $request->post('dy_nickname','');
Log::info('logs:' . json_encode($item));
$back = $item->save();
if($back)

View File

@ -8,6 +8,7 @@ use app\model\DyOrders;
use app\model\OrderAfterSales;
use app\model\Orders;
use app\model\Products;
use app\server\Douyin;
use support\Log;
use support\Redis;
use support\Request;
@ -153,12 +154,31 @@ class DyNotifyController extends base {
if (!empty($item)) {
return $item;
}
// 查找用户归属
$product = Products::query()->where('third_product_id', $orderProduct['product_id'])->find();
$adminId = 0;
// 查找用户归属
try {
// 直播间uid
$dyService = new Douyin(5);
$dyRes = $dyService->_certificateList(1, null, null, $order['dy_order_id']);
if (!empty($dyRes) && $dyRes->data) {
$dyRes = json_decode(json_encode($dyRes->data), true);
$saleUserNickName = trim($dyRes['list'][0]['extra']['attribute']['sale_user_nickname']);
Log::info('$saleUserNickName:' . $saleUserNickName);
if (!empty($saleUserNickName)) {
$adminId = Admins::where('status', 1)->whereLike('dy_nickname', "%{$saleUserNickName}%")->value('id');
}
}
} catch (\Exception $e) {
Log::info('get admin_info error:' . $e->getMessage());
}
if (!$adminId) {
$product = Products::query()->where('third_product_id', $orderProduct['product_id'])->find();
if (!empty($product)) {
$adminId = Admins::where('status', 1)->whereFindInSet('product_ids', $product->id)->value('id');
}
}
if ($adminId) {
// 新获得一个用户的,提示管理员有新的订单
Redis::incrBy('CRM:USER:ONLINE:NEW:' . $adminId, 1);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}[data-v-921c829c].el-select{width:100%}.addRoutes[data-v-921c829c]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:end}

View File

@ -1 +0,0 @@
.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}[data-v-1c619b78].el-select{width:100%}.addRoutes[data-v-1c619b78]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:end}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long