setName('coupon_receive_end') ->setDescription('优惠券结束领取'); } protected function execute(Input $input, Output $output) { // 固定用券时间的优惠券活动,过了最后的用券时间,优惠券结束领取 (new Coupon())->where([ ['status', '=', CouponEnum::COUPON_STATUS_CONDUCT], ['use_time_type', '=', CouponEnum::USE_TIME_TYPE_FIXED], ['use_time_end', '<=', time()] ])->update([ 'status' => CouponEnum::COUPON_STATUS_END, 'update_time' => time() ]); } }