public static function isCouponCodes() { $c = new NotEqualsCond(new ARFieldHandle(__CLASS__, 'couponCode'), ''); $c->addAND(new EqualsCond(new ARFieldHandle(__CLASS__, 'isEnabled'), 1)); return ActiveRecordModel::getRecordCount(__CLASS__, new ARSelectFilter($c)); }