diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 2e46bce51..c4dcc6a47 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -383,7 +383,7 @@ class FinanceController extends ThinkController if ($page == 1) { $parentData = $this->getParentSpendData($root_id,$month,2); } - $map['chain'] =['like','%'.$root_id.'%']; + $map['chain'] =['like','%/'.$root_id.'/%']; $map['level'] = 2; } else if(!empty(I("sign"))){ $map['parent_id'] = ['neq',0]; @@ -461,7 +461,7 @@ class FinanceController extends ThinkController if ($page == 1) { $parentData = $this->getParentSpendData($root_id,$month,3); } - $map['chain'] =['like','%'.$root_id.'%']; + $map['chain'] =['like','%/'.$root_id.'/%']; $map['level'] = 3; } else if(!empty(I("sign"))){ @@ -539,7 +539,7 @@ class FinanceController extends ThinkController $parentData = $this->getParentSpendData($parent_id,$month,4); } - $map['chain'] =['like','%'.$parent_id.'%']; + $map['chain'] =['like','%/'.$parent_id.'/%']; $map['level'] = 4; } diff --git a/Application/Admin/Model/MemberModel.class.php b/Application/Admin/Model/MemberModel.class.php index ed1365e8d..49ac7baf0 100644 --- a/Application/Admin/Model/MemberModel.class.php +++ b/Application/Admin/Model/MemberModel.class.php @@ -79,7 +79,7 @@ class MemberModel extends Model { ); session('user_auth', $auth); session('user_auth_sign', data_auth_sign($auth)); - setcookie(session_name(),session_id(),time()+3600); + session('user_auth_expire', time()); } public function getNickName($uid){ diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index eccf2aac5..a5874251a 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -92,7 +92,7 @@ class PromoteService { $balanceCoinMode = isset($params['balance_coin_mode']) ? $params['balance_coin_mode'] : 0; $type = isset($params['type']) ? $params['type'] : 0; $shiftIds = isset($params['shift_ids']) && $params['shift_ids'] ? $params['shift_ids'] : []; - $create_promote_id = empty(session('promote_auth.pid')) ? 0 : session('promote_auth.pid'); + $createPromoteId = empty(session('promote_auth.pid')) ? 0 : session('promote_auth.pid'); if ($fromPromoteId == $toPromoteId) { return [ @@ -106,6 +106,7 @@ class PromoteService { 'msg'=>'订单日期不能为空' ]; } + if ($type == 1 && $balanceCoinMode == 0) { return [ 'status' => false, @@ -113,6 +114,21 @@ class PromoteService { ]; } + if (count($shiftIds) > 15) { + return [ + 'status' => false, + 'msg'=>'部分迁移时,迁移人数不能超过15' + ]; + } + + $shiftTask = M('shift_task', 'sys_')->field(['id'])->where(['type' => $type, 'status' => 0, 'from_promote_id'])->find(); + if ($shiftTask) { + return [ + 'status' => false, + 'msg' => '含有类似未执行迁移任务,请稍后再试' + ]; + } + $isFuture = false; if (strtotime($orderTime) > strtotime(date('Y-m-d 23:59:59'))) { $isFuture = true; @@ -124,13 +140,13 @@ class PromoteService { 'order_time' => strtotime($orderTime), 'balance_coin_mode' => $balanceCoinMode, 'create_time' => time(), - 'create_promote_id' => $create_promote_id, + 'create_promote_id' => $createPromoteId, 'status' => 0, 'type' => $type, 'shift_ids' => json_encode($shiftIds) ]; - if (M('ShiftTask')->add($data)) { + if (M('shift_task', 'sys_')->add($data)) { return [ 'status' => true, 'msg'=>'迁移任务创建成功' diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index d3a793b4e..540686488 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -23,10 +23,19 @@ const ONETHINK_ADDON_PATH = './Addons/'; */ function is_login() { + // 判断是否过期 过期时间一个小时 + $expire = 3600; $user = session('user_auth'); if (empty($user)) { return 0; } else { + if (time() - intval(session('user_auth_expire')) > $expire) { // 过期正则直接去除掉session 并且返回false + session('user_auth', null); + session('user_auth_sign', null); + return 0; + } else { + session('user_auth_expire', time() + $expire); + } return session('user_auth_sign') == data_auth_sign($user) ? $user['uid'] : 0; } } diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index 159239644..a407002c1 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -874,8 +874,8 @@ class PromoteController extends BaseController if (count($ids) > 0) { $countList = M('promote', 'tab_')->field(['count(*)' => 'count', 'parent_id' => 'parent_id'])->where(['parent_id' => ['in', $ids]])->group('parent_id')->select(); $playerList = M('user_play', 'tab_')->field(['count(*)' => 'count', 'promote_id' => 'promote_id'])->where(['promote_id' => ['in', $ids]])->group('promote_id')->select(); - $shiftList = M('shift_task', 'sys_')->field(['count(*)' => 'count', 'from_promote_id' => 'from_promote_id'])->where(['status' => 0, 'type' => 1, 'promote_id' => ['in', $ids]])->group('from_promote_id')->select(); - $shiftPlayerList = M('shift_task', 'sys_')->field(['count(*)' => 'count', 'from_promote_id' => 'from_promote_id'])->where(['status' => 0, 'type' => 2, 'promote_id' => ['in', $ids]])->group('from_promote_id')->select(); + $shiftList = M('shift_task', 'sys_')->field(['count(*)' => 'count', 'from_promote_id' => 'from_promote_id'])->where(['status' => 0, 'type' => 1, 'from_promote_id' => ['in', $ids]])->group('from_promote_id')->select(); + $shiftPlayerList = M('shift_task', 'sys_')->field(['count(*)' => 'count', 'from_promote_id' => 'from_promote_id'])->where(['status' => 0, 'type' => 2, 'from_promote_id' => ['in', $ids]])->group('from_promote_id')->select(); $hasChildList = array_column($countList, 'parent_id'); $hasPlayerList = array_column($playerList, 'promote_id'); $hasShiftList = array_column($shiftList, 'from_promote_id'); diff --git a/Application/Home/View/default/Promote/children.html b/Application/Home/View/default/Promote/children.html index 1c9da8225..3655f0055 100644 --- a/Application/Home/View/default/Promote/children.html +++ b/Application/Home/View/default/Promote/children.html @@ -1,6 +1,9 @@ + + +
@@ -16,7 +19,7 @@
@@ -60,7 +63,7 @@

暂无数据

- + {$record.id} {$record.account} {$record.real_name} @@ -137,6 +140,7 @@