12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- /**
- * Created by north.Deng's MAC
- * User: north.Deng
- * Date: 2018/5/4
- * Time: 下午1:12
- * description :
- */
-
- class ResetDegreeCommand extends CConsoleCommand
- {
- public function run($args){
- //error_reporting(E_ERROR);
- ini_set('memory_limit', '256M');
- //ini_set('mongo.long_as_object',1);
- set_time_limit(0);
- self::reset();
- }
- public function reset()
- {
- $emp = JGEmploye::model()->findAll();
- foreach ($emp as $value) {
- $value->degree = 1;
- $value->save();
- }
- $c= new EMongoCriteria();
- $c->expire_time('<=',time());
- $coupons = JCoupon::model()->findAll($c);
- foreach ($coupons as $coupon) {
- $coupon->status = 2;
- $coupon->save();
- }
- }
- }
|