同步订单状态
This commit is contained in:
parent
2dd2fed0c0
commit
74e711a449
|
@ -82,7 +82,7 @@ export const asyncRoutes = [
|
|||
meta: {
|
||||
title: "系统管理",
|
||||
icon: "el-icon-s-home",
|
||||
roles: ["admin"],
|
||||
roles: ["admin", "franchisee"],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ export const asyncRoutes = [
|
|||
name: "Admin",
|
||||
meta: {
|
||||
title: "管理员",
|
||||
roles: ["admin"],
|
||||
roles: ["admin", "franchisee"],
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ export const asyncRoutes = [
|
|||
meta: {
|
||||
title: "订单管理",
|
||||
icon: "money",
|
||||
roles: ["order_index", "editor"],
|
||||
roles: ["order_index", "editor", "franchisee"],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ export const asyncRoutes = [
|
|||
name: "OrderList",
|
||||
meta: {
|
||||
title: "订单列表",
|
||||
roles: ["order_pub", "editor"],
|
||||
roles: ["order_pub", "editor", "franchisee"],
|
||||
},
|
||||
},
|
||||
/* {
|
||||
|
@ -233,7 +233,7 @@ export const asyncRoutes = [
|
|||
name: "OrderBack",
|
||||
meta: {
|
||||
title: "已退款订单",
|
||||
roles: ["order_back", "editor"],
|
||||
roles: ["order_back", "editor", "franchisee"],
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -39,8 +39,8 @@ module.exports = {
|
|||
proxy: {
|
||||
"/dev-api": {
|
||||
// 接口地址 以 api开头的都走下面的配置
|
||||
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: '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://192.168.0.100:8787",
|
||||
ws: true, // 是否支持 websocket 请求 支持
|
||||
changeOrigin: true, // 是否启用跨域
|
||||
|
|
|
@ -31,6 +31,10 @@ class AdminController extends base
|
|||
//$query->where('route_type', $routeType);
|
||||
}
|
||||
|
||||
if ($request->admin->is_franchisee == 1) {
|
||||
$query->where('pid', $request->admin->id);
|
||||
}
|
||||
|
||||
$list = $query->paginate($request->get('limit',10));
|
||||
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);
|
||||
}else{
|
||||
$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(!empty($name) && $item->name != $name) {
|
||||
|
@ -217,4 +222,4 @@ class AdminController extends base
|
|||
|
||||
return $this->success(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class LoginController extends base
|
|||
if(empty($password)) {
|
||||
return $this->error(1002);
|
||||
}
|
||||
|
||||
|
||||
$admin = Admins::where('username', $username)->find();
|
||||
// $admin->password = 'Aa123456';
|
||||
// $admin->save();
|
||||
|
@ -46,16 +46,17 @@ class LoginController extends base
|
|||
'username' => $admin->username,
|
||||
'name' => $admin->name,
|
||||
'avatar' => $admin->avatar,
|
||||
'is_super' => $admin->is_super
|
||||
'is_super' => $admin->is_super,
|
||||
'is_franchisee' => $admin->is_franchisee
|
||||
];
|
||||
|
||||
|
||||
$payload = array(
|
||||
"iat" => $time, // token 的创建时间
|
||||
"nbf" => $time, // token 的生效时间
|
||||
"exp" => $time+3600*24, // token 的过期时间
|
||||
"data"=> $data // 携带数据
|
||||
);
|
||||
|
||||
|
||||
$keyId = "keyId";
|
||||
$token = JWT::encode($payload, config('app.jwt_key_admin'), 'HS256', $keyId);
|
||||
|
||||
|
|
|
@ -102,7 +102,9 @@ class OrderController extends base
|
|||
}
|
||||
|
||||
$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');
|
||||
$query->where('admin_id', $admin_id);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ use app\model\DyOrders;
|
|||
use app\model\Orders;
|
||||
use app\model\Products;
|
||||
use support\Log;
|
||||
use support\Redis;
|
||||
use support\Request;
|
||||
use think\facade\Db;
|
||||
|
||||
|
@ -157,6 +158,10 @@ class DyNotifyController extends base {
|
|||
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);
|
||||
}
|
||||
|
||||
// 订单支付成功,写入平台订单表
|
||||
$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 #####
|
||||
ALTER TABLE `orders`
|
||||
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