Authored by 郝肖肖

店铺优惠券加密

... ... @@ -12,6 +12,7 @@ use Plugin\DataProcess\ShopProcess;
use Plugin\Helpers;
use Plugin\Cache;
use Plugin\Images;
use Plugin\Encryption;
/**
* 商品列表相关的模板数据模型
... ... @@ -510,7 +511,7 @@ class ListModel
if ($value['status'] === 1 || $value['status'] === 3) {
$shopCoupons[] = array(
'validity' => $value['couponValidity'],
'id' => $value['coupon_id'],
'id' => Encryption::encrypt($value['coupon_id']),
'name' => $value['coupon_name'],
'pic' => $value['coupon_pic'],
'money' => $value['money'],
... ...
... ... @@ -6,6 +6,7 @@ use LibModels\Wap\Product\ShopData;
use Plugin\Helpers;
use Product\ListModel;
use LibModels\Wap\Coupon\CouponData;
use Plugin\Encryption;
/**
* 商品列表相关的控制器
... ... @@ -719,17 +720,21 @@ class IndexController extends AbstractAction
* @return json
*/
public function userCouponAction() {
$data = array();
$appVersion = $this->post('app_version', 0);
$couponID = $this->post('couponID', 0);
if (empty($couponID)) {
exit(0);
}
if (empty($appVersion)){
$uid = $this->getUid();
} else {
$uid = $this->getCookie('appUid');
}
$data = array();
do {
if (empty($uid)) {
... ... @@ -743,7 +748,7 @@ class IndexController extends AbstractAction
break;
}
$data = CouponData::receiveCoupon($uid, $couponID);
$data = CouponData::receiveCoupon($uid, Encryption::decrypt($couponID));
} while(false);
$this->echoJson($data);
... ...