123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\api\controller;
- use app\api\model\UsersModel;
- use think\Controller;
- use think\Db;
- /**
- * 宝塔计划任务类
- * @ApiInternal
- * Class Plan
- * @package app\api\controller
- */
- class Plan extends Controller
- {
- // 每月清空VIP开通限制 /api/plan/clearVipData
- public function clearVipData()
- {
- $ids = UsersModel::field('user_id')->select();
- $ip = $this->request->ip();
- foreach ($ids as $v) {
- UsersModel::where('user_id', $v['user_id'])->update(['vip_use_num' => 0, 'vip_discount_quota' => 0]);
- }
- $info = array(
- 'desc' => '每月清空VIP开通限制',
- 'status' => '成功',
- 'ip' => $ip,
- 'time' => date('Y-m-d H:i:s' ,time())
- );
- Db::name('plan_log')->insert($info);
- }
- // 清空今日已用的基础排队次数 /api/plan/clearTodayQueueUseNum
- public function clearTodayQueueUseNum()
- {
- $ids = UsersModel::field('user_id')->select();
- $ip = $this->request->ip();
- foreach ($ids as $v) {
- UsersModel::where('user_id', $v['user_id'])->update(['queue_num_today' => 0]);
- }
- $info = array(
- 'desc' => '每天清空已用基础排队次数',
- 'status' => '成功',
- 'ip' => $ip,
- 'time' => date('Y-m-d H:i:s' ,time())
- );
- Db::name('plan_log')->insert($info);
- }
- }
|