Przeglądaj źródła

用户状态调整/充值超时计划任务调整

zhangxiaobin 1 rok temu
rodzic
commit
4d623d7faa

+ 2 - 1
application/admin/lang/zh-cn/user/user.php

@@ -44,7 +44,8 @@ return [
     'Token'                                       => 'Token',
     'Status'                                      => '状态',
     'Normal'                                      => '正常',
-    'Hidden'                                      => '禁用',
+    'Hidden'                                      => '封禁',
+    'Cancel'                                      => '取消',
     'Is_cool'                                     => '靓号',
     'Is_cool 0'                                   => '否',
     'Is_cool 1'                                   => '是',

+ 1 - 1
application/admin/model/User.php

@@ -64,7 +64,7 @@ class User extends Model
 
     public function getStatusList()
     {
-        return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
+        return ['normal' => __('Normal'), 'hidden' => __('Hidden'), 'cancel' => __('Cancel')];
     }
 
     public function getNeedCheckList()

+ 5 - 1
application/admin/view/user/user/edit.html

@@ -72,7 +72,11 @@
     <div class="form-group">
         <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
         <div class="col-xs-12 col-sm-8">
-            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}
+            <div class="radio">
+                {foreach name="statusList" item="vo"}
+                    <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
+                {/foreach}
+            </div>
         </div>
     </div>
     <div class="form-group layer-footer">

+ 0 - 22
application/api/controller/Money.php

@@ -1886,26 +1886,4 @@ class Money extends Common
         }
     }
 
-    /**
-     * 支付超时关闭
-     * @return void
-     */
-    public function recharOrderCancel()
-    {
-        try {
-            $maxTime = 1;
-            $createTimeEnd = time() - (60 * $maxTime);
-            $where['createtime'] = ['elt',$createTimeEnd];
-            $where['status'] = 0;
-            $recharOrder = model('RecharOrder')->where($where)->count();
-            $recharOrderRes = 0;
-            if (!empty($recharOrder)) {
-                $recharOrderRes = model('RecharOrder')->where($where)->update(['status' => -1]);
-            }
-            $this->success('操作成功',$recharOrderRes);
-        } catch (Exception $e) {
-            $this->error($e->getMessage());
-        }
-    }
-
 }

+ 8 - 2
application/common/library/Auth.php

@@ -96,8 +96,14 @@ class Auth
                 $this->setError('Account not exist');
                 return false;
             }
-            if (!in_array($user['status'],['normal','new'])) {
-                $this->setError('Account is locked');
+            if (!in_array($user['status'],['normal'])) {
+                if ($user['status'] == 'hidden') {
+                    $this->setError('Account is locked');
+                } else if ($user['status'] == 'cancel') {
+                    $this->setError('账号已注销');
+                } else {
+                    $this->setError('账号状态异常');
+                }
                 return false;
             }
 

+ 31 - 0
application/index/controller/TaskList.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace app\index\controller;
+
+use think\Controller;
+use think\Exception;
+
+class TaskList extends Controller
+{
+    /**
+     * 支付超时关闭
+     * @return void
+     */
+    public function recharOrderCancel()
+    {
+        try {
+            $maxTime = 1;//处理1分钟前的数据
+            $createTimeEnd = time() - (60 * $maxTime);
+            $where['createtime'] = ['elt',$createTimeEnd];
+            $where['status'] = 0;
+            $recharOrder = model('RecharOrder')->where($where)->count();
+            $recharOrderRes = 0;
+            if (!empty($recharOrder)) {
+                $recharOrderRes = model('RecharOrder')->where($where)->update(['status' => -1]);
+            }
+            $this->success('操作成功',$recharOrderRes);
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+}