|
@@ -100,17 +100,24 @@ class RechargeController extends AdminController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $coupon = new MongoId($coupon);
|
|
|
- $coupon_obj = Coupon::get($coupon);
|
|
|
|
|
|
- if (!$coupon_obj) {
|
|
|
- CommonFn::requestAjax(false, '代金券不存在');
|
|
|
- break;
|
|
|
+ if (CommonFn::isMongoId($coupon)) {
|
|
|
+ $coupon = new MongoId($coupon);
|
|
|
+ $coupon_obj = Coupon::get($coupon);
|
|
|
+
|
|
|
+ if (!$coupon_obj) {
|
|
|
+ CommonFn::requestAjax(false, '代金券不存在');
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ $coupons_obj[$key] = $coupon;
|
|
|
+ }
|
|
|
} else {
|
|
|
- $coupons_obj[$key] = $coupon;
|
|
|
+ CommonFn::requestAjax(false, '代金券输入错误');
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
} else{
|
|
|
//返现
|
|
|
$cash_back = intval(Yii::app()->request->getParam('cash_back', ''));
|