From 2561809d8450f7669f84dffa1e738a8a301092dd Mon Sep 17 00:00:00 2001
From: yaosen <741606767@qq.com>
Date: Wed, 26 Jun 2024 15:38:38 +0800
Subject: [PATCH] a
---
admin/src/api/qa.js | 13 +---
admin/src/layout/components/Navbar.vue | 36 +++++-----
admin/src/router/index.js | 2 +-
admin/src/views/log/index.vue | 2 +-
admin/src/views/onlines/online.vue | 21 +++---
admin/src/views/order/index.vue | 2 +-
admin/src/views/order/product.vue | 2 +-
.../app/admin/controller/AdminController.php | 54 ++++++--------
.../app/admin/controller/CityController.php | 14 ----
.../app/admin/controller/IndexController.php | 45 +++++++-----
.../app/admin/controller/LoginController.php | 6 ++
.../app/admin/controller/OrderController.php | 71 ++++++++++++++-----
service/app/admin/controller/QaController.php | 17 ++---
.../app/admin/controller/WatchController.php | 17 +++--
.../app/admin/controller/WorkController.php | 14 ----
service/app/command/SpiderMt.php | 20 ++++--
service/app/model/Logs.php | 4 +-
service/process/Monitor.php | 2 +-
18 files changed, 177 insertions(+), 165 deletions(-)
delete mode 100644 service/app/admin/controller/CityController.php
diff --git a/admin/src/api/qa.js b/admin/src/api/qa.js
index bf84351e..2bbb11c4 100644
--- a/admin/src/api/qa.js
+++ b/admin/src/api/qa.js
@@ -8,22 +8,11 @@ export function login(data) {
})
}
-// 获取城市列表
-export function getCityList() {
- return request({
- url: '/admin/city/getCityList',
- method: 'get'
- })
-}
-
// 获取子集列表
-export function getQaList(city_id) {
+export function getQaList() {
return request({
url: '/admin/qa/getQaList',
method: 'get',
- params: {
- city_id
- }
})
}
// 获取qa详情
diff --git a/admin/src/layout/components/Navbar.vue b/admin/src/layout/components/Navbar.vue
index 6c03a6fd..0d669797 100644
--- a/admin/src/layout/components/Navbar.vue
+++ b/admin/src/layout/components/Navbar.vue
@@ -129,7 +129,7 @@
关 闭
返 回
-
+
{{ item.city_name }}
@@ -152,7 +152,7 @@ import Search from '@/components/HeaderSearch'
import { color } from 'echarts/lib/export'
import sidebar from '@/layout/components/Sidebar/index.vue'
import avatar from 'element-ui/packages/avatar'
-import { getCityList, getQaList, getQaDetail } from '@/api/qa'
+import { getQaList } from '@/api/qa'
import clickoutside from 'element-ui/src/utils/clickoutside'
export default {
directives: { clickoutside },
@@ -189,7 +189,7 @@ export default {
imageUrl: false,
QaShow: true,
os: [],
- getCityList: [],
+ getQaList: [],
times: [],
form: {
oldpwd: '',
@@ -213,8 +213,8 @@ export default {
},
created() {
this.getworkstatus()
- getCityList().then(res => {
- this.getCityList = res.data
+ getQaList().then(res => {
+ this.getQaList = res.data
})
},
methods: {
@@ -226,18 +226,16 @@ export default {
this.drawer = false
this.QaShow = true
},
- getQaDetail(id) {
- getQaDetail(id).then(res => {
- this.QaInfo = res.data
- if (!this.QaInfo) {
- return this.$message({
- message: '暂无QA问题',
- type: 'warning',
- duration: 1500
- })
- }
- this.QaShow = false
- })
+ getQaDetail(data) {
+ this.QaInfo = data
+ if (!this.QaInfo) {
+ return this.$message({
+ message: '暂无QA问题',
+ type: 'warning',
+ duration: 1500
+ })
+ }
+ this.QaShow = false
},
async logout() {
await this.$store.dispatch('user/logout')
@@ -267,7 +265,7 @@ export default {
})
},
startWorks() {
- this.$axios.post('/admin/work/startworks', { id: this.id }).then(res => {
+ this.$axios.post('/admin/admin/editInfo', { is_order: 1 }).then(res => {
console.log(res)
this.$message({
showClose: true,
@@ -279,7 +277,7 @@ export default {
})
},
endWorks() {
- this.$axios.post('/admin/work/endworks', { id: this.id }).then(res => {
+ this.$axios.post('/admin/admin/editInfo', { is_order: 0 }).then(res => {
console.log(res)
this.$message({
showClose: true,
diff --git a/admin/src/router/index.js b/admin/src/router/index.js
index 459d8b94..e977a038 100644
--- a/admin/src/router/index.js
+++ b/admin/src/router/index.js
@@ -98,7 +98,7 @@ export const asyncRoutes = [
component: () => import('@/views/onlines/online.vue'),
name: 'onlines',
meta: {
- title: '在线客服列表',
+ title: '在线客服',
roles: ['admin']
}
}/*,
diff --git a/admin/src/views/log/index.vue b/admin/src/views/log/index.vue
index 9cb52bba..4884a621 100644
--- a/admin/src/views/log/index.vue
+++ b/admin/src/views/log/index.vue
@@ -24,7 +24,7 @@
-
+
diff --git a/admin/src/views/onlines/online.vue b/admin/src/views/onlines/online.vue
index 4ccd7057..706d3006 100644
--- a/admin/src/views/onlines/online.vue
+++ b/admin/src/views/onlines/online.vue
@@ -2,7 +2,7 @@
-
+
下线
@@ -15,22 +15,27 @@
-
+
+
- {{ Math.floor((scope.row.data ? scope.row.data.onlineTime : scope.row.onlineTime) / 3600) || '--' }} 分钟
+ {{ Math.floor((scope.row.data ? scope.row.data.onlineTime : scope.row.onlineTime) / 60) || '--' }} 分钟
-
+
{{ scope.row.start_work_time | parseTime('{y}-{m}-{d} {h}:{i}') }}
-
+
+
+ {{ scope.row.last_work_time | parseTime('{y}-{m}-{d} {h}:{i}') }}
+
+
+
{{ scope.row.end_work_time | parseTime('{y}-{m}-{d} {h}:{i}') }}
@@ -70,7 +75,7 @@ export default {
},
methods: {
getOnlineList() {
- this.listLoading = true // /admin/admin/getOnlineList /admin/shortcutContent/list
+ this.listLoading = true
this.$axios.get('/admin/admin/getOnlineList', { params: this.listQuery }).then(response => {
this.list = response.data
this.listLoading = false
diff --git a/admin/src/views/order/index.vue b/admin/src/views/order/index.vue
index 51123557..c7318912 100644
--- a/admin/src/views/order/index.vue
+++ b/admin/src/views/order/index.vue
@@ -121,7 +121,7 @@
-
+
diff --git a/admin/src/views/order/product.vue b/admin/src/views/order/product.vue
index f6836dfb..c795b2d3 100644
--- a/admin/src/views/order/product.vue
+++ b/admin/src/views/order/product.vue
@@ -20,7 +20,7 @@
-
+
diff --git a/service/app/admin/controller/AdminController.php b/service/app/admin/controller/AdminController.php
index 23ae0448..bed647fd 100644
--- a/service/app/admin/controller/AdminController.php
+++ b/service/app/admin/controller/AdminController.php
@@ -131,48 +131,28 @@ class AdminController extends base
public function getOnlineList(Request $request)
{
$list = [];
- $todayStart = strtotime(date('Y-m-d'));
- $todayEnd = $todayStart + 86399;
-
- // 获取今天在线的记录
- $onlines = Onlines::alias('o')
- ->field('o.*, a.id as admin_id, a.name') // 选择需要的字段
- ->join('admins a', 'o.admin_id = a.id', 'LEFT') // 关联admins表
- ->where('start','>=',$todayStart)
- ->where('end','<=',$todayEnd)
- ->select();
-
- foreach ($onlines as $online) {
- $adminId = $online->admin_id;
- $list[$adminId]['id'] = $adminId;
- $list[$adminId]['name'] = $online->name;
- $list[$adminId]['onlineTime'] = $list[$adminId]['onlineTime'] ?? 0 + (($online->end ? $online->end : $todayEnd) - $online->start);
- $list[$adminId]['isOnline'] = Redis::get('CRM:USER:ONLINE:'.$online->admin_id) ? 1 : 0;
- }
-
$users = Admins::where('status',1)->select();
foreach ($users as $user){
$adminId = $user->id;
- if (empty($list[$user->id])){
- $list[$adminId]['id'] = $adminId;
- $list[$adminId]['name'] = $user->name;
- $list[$adminId]['onlineTime'] = 0;
- $list[$adminId]['isOnline'] = 2;
- }
- if (!isset($list[$adminId]['isOnline'])){
- $list[$adminId]['isOnline'] = 0;
- }
-
-// if ($user->is_order == 1 && $list[$adminId]['isOnline'] ==1){
+ $list[$adminId]['isEndWork'] = 0;
if ($user->is_order == 1){
$list[$adminId]['isEndWork'] = 1;//是否分单
- }else{
- $list[$adminId]['isEndWork'] = 0;
}
+
+ if (!empty($user->end_work_time)) {
+ $list[$adminId]['onlineTime'] = strtotime(date('Y-m-d H:i:00',$user->end_work_time)) - strtotime(date('Y-m-d H:i:00',$user->start_work_time));
+ }else{
+ $list[$adminId]['onlineTime'] = $user->last_work_time > 0 ? strtotime(date('Y-m-d H:i:00',$user->last_work_time)) - strtotime(date('Y-m-d H:i:00',$user->start_work_time)) : 0;
+ }
+
$list[$adminId]['start_work_time'] = $user->start_work_time;
$list[$adminId]['end_work_time'] = $user->end_work_time;
+ $list[$adminId]['last_work_time'] = $user->last_work_time;
$list[$adminId]['order_num'] = $user->order_num;
+ $list[$adminId]['id'] = $adminId;
+ $list[$adminId]['username'] = $user->username;
+ $list[$adminId]['isOnline'] = Redis::get('CRM:USER:ONLINE:'.$adminId) ? 1 : 0;
}
return $this->success(array_values($list));
@@ -181,7 +161,15 @@ class AdminController extends base
public function editInfo(Request $request)
{
$post = $request->post();
- if (empty($post['id'])) return $this->error(500, '参数错误');
+
+ if (empty($post['id'])){
+ $post['id'] = $request->admin->id;
+ }
+
+ $post['end_work_time'] = time();
+ if ($post['is_order'] == 1){
+ $post['end_work_time'] = 0;
+ }
try {
Admins::update($post);
diff --git a/service/app/admin/controller/CityController.php b/service/app/admin/controller/CityController.php
deleted file mode 100644
index 11672af1..00000000
--- a/service/app/admin/controller/CityController.php
+++ /dev/null
@@ -1,14 +0,0 @@
-where('status','=',1)->order('sort','desc')->select();
- return $this->success($list);
- }
-}
\ No newline at end of file
diff --git a/service/app/admin/controller/IndexController.php b/service/app/admin/controller/IndexController.php
index 2cd5e6af..6f87130b 100644
--- a/service/app/admin/controller/IndexController.php
+++ b/service/app/admin/controller/IndexController.php
@@ -90,25 +90,29 @@ class IndexController extends base
public function orders(Request $request)
{
+ $order = Orders::where('sn','>',0)
+ ->fieldRaw('
+ SUM(IF(status=0,1,0)) as wait,
+ SUM(IF(status=1,1,0)) as doing,
+ SUM(total_price) as total,
+ count(id) as `all`,
+ SUM(IF(asset_price>0 AND status=2,1,0)) as asset,
+ SUM(IF(asset_price>0 AND status=2,asset_price,0)) as asset_price,
+ SUM(CASE
+ WHEN (os = 1 AND STATUS = 5) OR (os = 3 AND STATUS = 4) OR (os = 2 AND STATUS = 1) THEN 1
+ ELSE 0
+ END) AS refund,
+ SUM(CASE
+ WHEN (os = 1 AND STATUS = 5) OR (os = 3 AND STATUS = 4) OR (os = 2 AND STATUS = 1) THEN actual_price
+ ELSE 0
+ END) AS refund_price
+ ');
- $order = Orders::where('admin_id', $request->admin->id)->fieldRaw('
- SUM(IF(status=0,1,0)) as wait,
- SUM(IF(status=1,1,0)) as doing,
- SUM(total_price) as total,
- count(id) as `all`,
- SUM(IF(asset_price>0 AND status=2,1,0)) as asset,
- SUM(IF(asset_price>0 AND status=2,asset_price,0)) as asset_price,
- SUM(CASE
- WHEN (os = 1 AND STATUS = 5) OR (os = 3 AND STATUS = 4) OR (os = 2 AND STATUS = 1) THEN 1
- ELSE 0
- END) AS refund,
- SUM(CASE
- WHEN (os = 1 AND STATUS = 5) OR (os = 3 AND STATUS = 4) OR (os = 2 AND STATUS = 1) THEN actual_price
- ELSE 0
- END) AS refund_price
- ')->find();
+ if ($request->admin->id !=1){
+ $order = $order->where('admin_id', $request->admin->id);
+ }
-// Log::warning("=====",['sql'=>$order]);
+ $order = $order->find();
return $this->success([
'wait' => $order->wait ?? 0,
@@ -191,7 +195,7 @@ class IndexController extends base
$limit = $request->get('limit', 10);
$product_name = $request->get('product_name');
$os = $request->get('os_status');
- $list = Orders::where('admin_id',$request->admin->id)
+ $list = Orders::where('sn','>',0)
->fieldRaw('
os,product_name,
SUM(IF(status=0,1,0)) as wait,
@@ -211,12 +215,17 @@ class IndexController extends base
')
->group('os,product_name')
->order('total desc');
+
+ if ($request->admin->id !=1){
+ $list = $list->where('admin_id', $request->admin->id);
+ }
if (!empty($os)){
$list = $list->where('os',$os);
}
if (!empty($product_name)){
$list = $list->where('product_name','like','%'.$product_name.'%');
}
+
$list = $list->paginate($limit);
return $this->success($list);
}
diff --git a/service/app/admin/controller/LoginController.php b/service/app/admin/controller/LoginController.php
index df8a47d2..137e8a4a 100644
--- a/service/app/admin/controller/LoginController.php
+++ b/service/app/admin/controller/LoginController.php
@@ -35,6 +35,12 @@ class LoginController extends base
return $this->error(1004,'管理员状态错误'); //管理员状态错误
}
+ // 记录当天第一次上线时间
+ if (date('Y-m-d') != date('Y-m-d',$admin->start_work_time)){
+ $admin->start_work_time = $time;
+ $admin->save();
+ }
+
$data = [
'id'=> $admin->id,
'username' => $admin->username,
diff --git a/service/app/admin/controller/OrderController.php b/service/app/admin/controller/OrderController.php
index 7614a930..ab04b8e6 100644
--- a/service/app/admin/controller/OrderController.php
+++ b/service/app/admin/controller/OrderController.php
@@ -11,6 +11,7 @@ use stdClass;
use support\Log;
use support\Redis;
use support\Request;
+use think\facade\Db;
class OrderController extends base
{
@@ -37,7 +38,7 @@ class OrderController extends base
->order('update_time','desc')
->order('id','desc');
- if($status!==null && $status >= 0) {
+ if($status!=null && $status >= 0) {
$query->where('status', $status);
}
@@ -304,7 +305,7 @@ class OrderController extends base
$query->where('order_id', $order_id);
}
- if($status !== null) {
+ if($status != null) {
$query->where('status', $status);
}
@@ -336,19 +337,38 @@ class OrderController extends base
if(empty($item)) return $this->error(2002, '订单没有找到');
if($item->admin_id == $admin_id) return $this->error(2002, '订单已经在账号上,不需要再拉取!');
- $back = Backs::create([
+ //管理员不用审批
+ $status = 0;
+ if ($request->admin->is_super == 1 || $request->admin->id == 1){
+ $status = 1;
+ }
+
+ $backs = [
'order_id' => $item->id,
'admin_id' => $admin_id,
'admin' => $item->admin_id,
- 'apply_id' => $request->admin->id
- ]);
- Logs::todo($item->id, $admin_id, 7);
+ 'apply_id' => $request->admin->id,
+ 'status' => $status
+ ];
+ try {
+ Db::transaction(function() use ($backs,$item) {
+ Backs::create($backs);
+ Logs::todo($backs['order_id'], $backs['apply_id'], $backs['status'] == 1 ? 12 : 7,$item->sn);
- if($back) {
- return $this->success($back);
- }else{
+ if ($backs['status'] == 1){//管理员审批处理
+ Orders::where('id', $backs['order_id'])->where('admin_id', $backs['admin'])->update(['admin_id'=> $backs['admin_id']]);
+ $other = Backs::where('order_id', $backs['order_id'])->where('status', 0)->lock()->select();
+ foreach($other as $o) {
+ Backs::where('id', $o->id)->where('status', 0)->update(['status' => 3]);
+ Logs::todo($o->order_id, $o->admin, 10); //取消其他转单需求
+ }
+ }
+ });
+ }catch (\Exception $e){
return $this->error(2003, '创建拉回记录失败了');
}
+
+ return $this->success(true);
}
public function toBack(Request $request) {
@@ -363,19 +383,38 @@ class OrderController extends base
if(empty($item)) return $this->error(2002, '订单没有找到');
if($item->admin_id == $admin_id) return $this->error(2002, '订单已经在账号上,不需要再拉取!');
- $back = Backs::create([
+ //管理员不用审批
+ $status = 0;
+ if ($request->admin->is_super == 1 || $request->admin->id == 1){
+ $status = 1;
+ }
+
+ $backs = [
'order_id' => $item->id,
'admin_id' => $admin_id,
'admin' => $item->admin_id,
- 'apply_id' => $request->admin->id
- ]);
- Logs::todo($item->id, $admin_id, 7);
+ 'apply_id' => $request->admin->id,
+ 'status' => $status
+ ];
+ try {
+ Db::transaction(function() use ($backs,$item) {
+ Backs::create($backs);
+ Logs::todo($backs['order_id'], $backs['apply_id'], $backs['status'] == 1 ? 12 : 7,$item->sn);
- if($back) {
- return $this->success($back);
- }else{
+ if ($backs['status'] == 1){//管理员审批处理
+ Orders::where('id', $backs['order_id'])->where('admin_id', $backs['admin'])->update(['admin_id'=> $backs['admin_id']]);
+ $other = Backs::where('order_id', $backs['order_id'])->where('status', 0)->lock()->select();
+ foreach($other as $o) {
+ Backs::where('id', $o->id)->where('status', 0)->update(['status' => 3]);
+ Logs::todo($o->order_id, $o->admin, 10); //取消其他转单需求
+ }
+ }
+ });
+ }catch (\Exception $e){
return $this->error(2003, '创建拉回记录失败了');
}
+
+ return $this->success(true);
}
/**
diff --git a/service/app/admin/controller/QaController.php b/service/app/admin/controller/QaController.php
index ab5abfab..50b7a20b 100644
--- a/service/app/admin/controller/QaController.php
+++ b/service/app/admin/controller/QaController.php
@@ -9,24 +9,17 @@ class QaController extends base
{
public function getQaList(Request $request)
{
- $cityId = $request->get('city_id');
- $limit = $request->get('limit', 10);
-
- if (empty($cityId)) return $this->error(2001, 'city_id cannot be empty!');
-
- $list = Qas::fieldRaw('city_id,title,content')->where('city_id', $cityId)->paginate($limit);
+ $list = Qas::fieldRaw('city_name,title,content')->select();
return $this->success($list);
}
public function getQaDetail(Request $request)
{
- $cityId = $request->get('city_id');
-// $id = $request->get('id');
+ $id = $request->get('id');
+ if (empty($id)) return $this->error(2001, 'id data cannot be empty!');
- if (empty($cityId)) return $this->error(2001, 'city_id cannot be empty!');
-
- $data = Qas::fieldRaw('city_id,title,content')->where([/*'id' => $id, */'city_id' => $cityId])->find();
+ $data = Qas::fieldRaw('id,city_name,title,content')->find();
return $this->success($data);
}
@@ -34,7 +27,7 @@ class QaController extends base
public function addQa(Request $request)
{
$post = $request->post();
- if (empty($post['city_id'])) return $this->error(2001, 'city_id data cannot be empty!');
+ if (empty($post['city_name'])) return $this->error(2001, 'city_name data cannot be empty!');
if (empty($post['title'])) return $this->error(2001, 'title data cannot be empty!');
if (empty($post['content'])) return $this->error(2001, 'content data cannot be empty!');
diff --git a/service/app/admin/controller/WatchController.php b/service/app/admin/controller/WatchController.php
index f20aeaab..d56f09f8 100644
--- a/service/app/admin/controller/WatchController.php
+++ b/service/app/admin/controller/WatchController.php
@@ -15,15 +15,21 @@ class WatchController extends base
$datas = Admins::order('create_time desc')->select();
foreach ($datas as $data) {
$item = [];
+
+ //set admin/index/isWork
$watch = Redis::get('CRM:USER:ONLINE:WATCH:'.$data->id);
- if (empty($data->start_work_time)){
- $item['start_work_time'] = $nowTime;
+ //记录下线时间
+ if (!empty($watch) && ($nowTime - $watch) > 6*60){
+ $item['end_work_time'] = $watch + 5*60;
}
- if (($nowTime - $watch) > 0 && ($nowTime - $watch) <= 6*60){
- $item['end_work_time'] = $nowTime;
+ //实时更新在线时间
+ if (($nowTime - $watch) <= 6*60){
+ $item['last_work_time'] = $nowTime;
}
- Log::warning('watchIsWork',['data'=>$item]);
+
+ //记录当天第一次上线时间 start_work_time admin/login/index
+
if (!empty($item)){
try {
Admins::where('id', $data->id)->update($item);
@@ -33,7 +39,6 @@ class WatchController extends base
}
}
}
- echo "========watchIsWork end======\n";
return;
}
}
\ No newline at end of file
diff --git a/service/app/admin/controller/WorkController.php b/service/app/admin/controller/WorkController.php
index 48c3ac25..03da0d4b 100644
--- a/service/app/admin/controller/WorkController.php
+++ b/service/app/admin/controller/WorkController.php
@@ -168,20 +168,6 @@ class WorkController extends base
return $this->success($anchor->hidden(['password', 'remember_token']));
}
- public function endworks(Request $request)
- {
-// Redis::set("CRM:USER:ENDWORK:".$request->admin->id,10*3600);
- Admins::update(['id' => $request->admin->id, 'is_order' => 0, 'end_work_time' => time()]);
- return $this->success(null);
- }
-
- public function startworks(Request $request)
- {
-// Redis::del("CRM:USER:ENDWORK:" . $request->admin->id);
- Admins::update(['id' => $request->admin->id, 'is_order' => 1,'start_work_time' => time()]);
- return $this->success(null);
- }
-
public function getworkstatus(Request $request)
{
// $workstatus = Redis::get("CRM:USER:ENDWORK:" . $request->admin->id);
diff --git a/service/app/command/SpiderMt.php b/service/app/command/SpiderMt.php
index a8358eeb..895fbc94 100644
--- a/service/app/command/SpiderMt.php
+++ b/service/app/command/SpiderMt.php
@@ -58,18 +58,24 @@ class SpiderMt extends Command
$_u->username = $u->id;
$us[] = $_u;
}*/
- if ($u->order_num > 0){
+ /*if ($u->order_num > 0){
+ if ($u->order_num !== $this->order_num){
+ $data = Admins::where('id',$u->id)->find();
+ $num = $data['order_num'] - 1;
+ if ($num >= 0){
+ Admins::where('id',$u->id)->update(['order_num'=>$num]);
+ }
+ }
$_u = new stdClass();
$_u->username = $u->id;
$us[] = $_u;
- if ($u->order_num != $this->order_num){
- Admins::where('id',$u->id)->decrement('order_num',1);
- }
- }
+ }*/
+
$_u = new stdClass();
$_u->username = $u->id;
$us[] = $_u;
- };
+ }
+
$this->_users = $us;
return $this->_users;
}
@@ -250,6 +256,7 @@ class SpiderMt extends Command
$order->is_check = 1;
$order->check_sn = $json->check_sn;
$order->admin_id = $json->admin_id;
+ $order->give_time = time();
$back = $order->save();
} elseif (!empty($order) && $order->admin_id !== $json->admin_id) {
echo '订单不在自己的名下,并且分人了。';
@@ -272,6 +279,7 @@ class SpiderMt extends Command
$item->admin_id = $json->admin_id;
$item->check_sn = $json->check_sn;
$item->is_check = 1;
+ $item->give_time = time();
$back = $item->save();
$order->is_change = $json->admin_id;
diff --git a/service/app/model/Logs.php b/service/app/model/Logs.php
index 09e115c3..409df248 100644
--- a/service/app/model/Logs.php
+++ b/service/app/model/Logs.php
@@ -3,7 +3,7 @@ namespace app\model;
class Logs extends base{
- const Actions = [1 => '查看电话', 2 => '核销订单', 3=> '核销订单', 4 => '分单', 5 => '加微信', 6 => '公海领取', 7 => '申请拉回订单', 8 => '确认拉单请求', 9 => '拒绝拉单请求', 10 => '取消拉单请求',11 => '核销失败'];
+ const Actions = [1 => '查看电话', 2 => '核销订单', 3=> '核销订单', 4 => '分单', 5 => '加微信', 6 => '公海领取', 7 => '申请拉回订单', 8 => '确认拉单请求', 9 => '拒绝拉单请求', 10 => '取消拉单请求',11 => '核销失败',12 => '管理员操作转单'];
public function getActionNameAttr($val) {
return self::Actions[$this->action] ?? '未知';
@@ -14,7 +14,7 @@ class Logs extends base{
}
public function orders(){
- return $this->belongsTo(Orders::class, 'admin_id');
+ return $this->belongsTo(Orders::class, 'order_id');
}
//查看详情
diff --git a/service/process/Monitor.php b/service/process/Monitor.php
index 67e5fe25..059ab741 100644
--- a/service/process/Monitor.php
+++ b/service/process/Monitor.php
@@ -246,7 +246,7 @@ class Monitor
public function onWorkerStart()
{
// 每秒钟执行一次
- new Crontab('*/1 * * * * *', function(){
+ new Crontab('1 * * * * *', function(){
WatchController::watchIsWork();
});
}