1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace app\api\controller;
- use AlibabaCloud\Client\AlibabaCloud;
- use AlibabaCloud\Client\Exception\ClientException;
- use AlibabaCloud\Client\Exception\ServerException;
- use think\Db;
- class Timedtask
- {
-
- public function userCouponOver()
- {
- Db::table('user_coupon_list')
- ->where('past_at','> time',date('Y-m-d H:i:s'))
- ->where('status','=',1)
- ->update(['status'=>3]);
- }
-
- public function integralClean()
- {
- $month = date('m');
- $clean_set = sysconf('integral_clean');
- var_dump($month,$clean_set);
- if($month == 1 && $clean_set != date('Y-m-d'))
- {
- var_dump(6666);
- Db::name('system_config')->where(['integral_clean'=>date('Y-m-d')]);
- $user_list = Db::name('store_member')->field('id,integral')->where('integral','>',0)->select();
- foreach ($user_list as $v) {
- update_user_integral($v['id'],$v['integral']*-1,10,'积分清零');
- }
- }
- }
- }
|