同步订单状态
This commit is contained in:
parent
2dd2fed0c0
commit
74e711a449
|
@ -82,7 +82,7 @@ export const asyncRoutes = [
|
||||||
meta: {
|
meta: {
|
||||||
title: "系统管理",
|
title: "系统管理",
|
||||||
icon: "el-icon-s-home",
|
icon: "el-icon-s-home",
|
||||||
roles: ["admin"],
|
roles: ["admin", "franchisee"],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,7 @@ export const asyncRoutes = [
|
||||||
name: "Admin",
|
name: "Admin",
|
||||||
meta: {
|
meta: {
|
||||||
title: "管理员",
|
title: "管理员",
|
||||||
roles: ["admin"],
|
roles: ["admin", "franchisee"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -179,7 +179,7 @@ export const asyncRoutes = [
|
||||||
meta: {
|
meta: {
|
||||||
title: "订单管理",
|
title: "订单管理",
|
||||||
icon: "money",
|
icon: "money",
|
||||||
roles: ["order_index", "editor"],
|
roles: ["order_index", "editor", "franchisee"],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -188,7 +188,7 @@ export const asyncRoutes = [
|
||||||
name: "OrderList",
|
name: "OrderList",
|
||||||
meta: {
|
meta: {
|
||||||
title: "订单列表",
|
title: "订单列表",
|
||||||
roles: ["order_pub", "editor"],
|
roles: ["order_pub", "editor", "franchisee"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
/* {
|
/* {
|
||||||
|
@ -233,7 +233,7 @@ export const asyncRoutes = [
|
||||||
name: "OrderBack",
|
name: "OrderBack",
|
||||||
meta: {
|
meta: {
|
||||||
title: "已退款订单",
|
title: "已退款订单",
|
||||||
roles: ["order_back", "editor"],
|
roles: ["order_back", "editor", "franchisee"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,8 +39,8 @@ module.exports = {
|
||||||
proxy: {
|
proxy: {
|
||||||
"/dev-api": {
|
"/dev-api": {
|
||||||
// 接口地址 以 api开头的都走下面的配置
|
// 接口地址 以 api开头的都走下面的配置
|
||||||
target: 'https://www.szjinao.cn', // 代理目标地址为后端服务器地址 127.0.0.1 192.168.1.2
|
// target: 'https://www.szjinao.cn', // 代理目标地址为后端服务器地址 127.0.0.1 192.168.1.2
|
||||||
// target: "http://hex.jipinq.cn", // 代理目标地址为后端服务器地址 127.0.0.1 192.168.1.2
|
target: "http://hex.jipinq.cn", // 代理目标地址为后端服务器地址 127.0.0.1 192.168.1.2
|
||||||
// target: "http://192.168.0.100:8787",
|
// target: "http://192.168.0.100:8787",
|
||||||
ws: true, // 是否支持 websocket 请求 支持
|
ws: true, // 是否支持 websocket 请求 支持
|
||||||
changeOrigin: true, // 是否启用跨域
|
changeOrigin: true, // 是否启用跨域
|
||||||
|
|
|
@ -31,6 +31,10 @@ class AdminController extends base
|
||||||
//$query->where('route_type', $routeType);
|
//$query->where('route_type', $routeType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->admin->is_franchisee == 1) {
|
||||||
|
$query->where('pid', $request->admin->id);
|
||||||
|
}
|
||||||
|
|
||||||
$list = $query->paginate($request->get('limit',10));
|
$list = $query->paginate($request->get('limit',10));
|
||||||
return $this->success($list->hidden(['password','remember_token']),null,['oss' => Orders::OSS]);
|
return $this->success($list->hidden(['password','remember_token']),null,['oss' => Orders::OSS]);
|
||||||
}
|
}
|
||||||
|
@ -83,9 +87,10 @@ class AdminController extends base
|
||||||
$item = (new Admins())->find($id);
|
$item = (new Admins())->find($id);
|
||||||
}else{
|
}else{
|
||||||
$item = new Admins();
|
$item = new Admins();
|
||||||
|
$item->pid = $request->admin->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$request->admin->is_super) return $this->error(2000, '超级管理员才可以管理人员');
|
if(!($request->admin->is_super || $request->admin->is_franchisee)) return $this->error(2000, '超级管理员或加盟商才可以管理人员');
|
||||||
|
|
||||||
if($item->id > 0) {
|
if($item->id > 0) {
|
||||||
if(!empty($name) && $item->name != $name) {
|
if(!empty($name) && $item->name != $name) {
|
||||||
|
|
|
@ -46,7 +46,8 @@ class LoginController extends base
|
||||||
'username' => $admin->username,
|
'username' => $admin->username,
|
||||||
'name' => $admin->name,
|
'name' => $admin->name,
|
||||||
'avatar' => $admin->avatar,
|
'avatar' => $admin->avatar,
|
||||||
'is_super' => $admin->is_super
|
'is_super' => $admin->is_super,
|
||||||
|
'is_franchisee' => $admin->is_franchisee
|
||||||
];
|
];
|
||||||
|
|
||||||
$payload = array(
|
$payload = array(
|
||||||
|
|
|
@ -102,7 +102,9 @@ class OrderController extends base
|
||||||
}
|
}
|
||||||
|
|
||||||
$admin = $request->get('admin');
|
$admin = $request->get('admin');
|
||||||
if($admin){
|
if ($request->admin->is_franchisee == 1) {
|
||||||
|
$query->whereRaw(sprintf('admin_id in (select id from admins where pid = "%s")', $request->admin->id));
|
||||||
|
} elseif($admin){
|
||||||
$admin_id = Admins::where('username', $admin)->value('id');
|
$admin_id = Admins::where('username', $admin)->value('id');
|
||||||
$query->where('admin_id', $admin_id);
|
$query->where('admin_id', $admin_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ use app\model\DyOrders;
|
||||||
use app\model\Orders;
|
use app\model\Orders;
|
||||||
use app\model\Products;
|
use app\model\Products;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
|
use support\Redis;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
|
|
||||||
|
@ -157,6 +158,10 @@ class DyNotifyController extends base {
|
||||||
if (!empty($product)) {
|
if (!empty($product)) {
|
||||||
$adminId = Admins::where('status', 1)->whereFindInSet('product_ids', $product->id)->value('id');
|
$adminId = Admins::where('status', 1)->whereFindInSet('product_ids', $product->id)->value('id');
|
||||||
}
|
}
|
||||||
|
if ($adminId) {
|
||||||
|
// 新获得一个用户的,提示管理员有新的订单
|
||||||
|
Redis::incrBy('CRM:USER:ONLINE:NEW:' . $adminId, 1);
|
||||||
|
}
|
||||||
|
|
||||||
// 订单支付成功,写入平台订单表
|
// 订单支付成功,写入平台订单表
|
||||||
$item = new Orders();
|
$item = new Orders();
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -41,3 +41,12 @@ update orders set verification_date =( SELECT FROM_UNIXTIME(create_time) FROM `f
|
||||||
##### 2024-11-21 #####
|
##### 2024-11-21 #####
|
||||||
ALTER TABLE `orders`
|
ALTER TABLE `orders`
|
||||||
ADD COLUMN `is_direct_mode` tinyint NOT NULL DEFAULT 0 COMMENT '是否直连模式(0-否,1-是)' AFTER `verification_date`;
|
ADD COLUMN `is_direct_mode` tinyint NOT NULL DEFAULT 0 COMMENT '是否直连模式(0-否,1-是)' AFTER `verification_date`;
|
||||||
|
|
||||||
|
|
||||||
|
1个连接的 需求内存为 256k
|
||||||
|
16G 最大连接数 65536
|
||||||
|
|
||||||
|
|
||||||
|
// 加盟商
|
||||||
|
ALTER TABLE `admins`
|
||||||
|
ADD COLUMN `pid` int NOT NULL DEFAULT 0 COMMENT '上级ID';
|
||||||
|
|
Loading…
Reference in New Issue