|
@@ -21,9 +21,6 @@ class ActivityController extends O2oBaseController {
|
|
|
$home_page = Yii::app()->getRequest()->getParam("home_page",'');
|
|
|
$userId = Yii::app()->request->getParam('userId','');
|
|
|
$appToken = '';
|
|
|
- echo "1";
|
|
|
- var_dump($userId);
|
|
|
- var_dump($state);
|
|
|
if($code && $state){
|
|
|
$accessInfo = CommonWeixin::getAccessInfo($code);
|
|
|
$userId = '';
|
|
@@ -89,17 +86,14 @@ class ActivityController extends O2oBaseController {
|
|
|
$coupon_id =new MongoId($coupon_id);
|
|
|
$start_time = time(); //发放优惠券可用开始时间
|
|
|
$end_time = $start_time + 86400*30; //发放优惠券过期时间
|
|
|
- var_dump($userId);
|
|
|
- if (!CommonFn::isMongoId($userId)) {
|
|
|
- $userId = new MongoId($userId);
|
|
|
- }
|
|
|
- if ($coupon_id) {
|
|
|
- if ($userId) {
|
|
|
- Service::factory('CouponService')->giveCoupon($userId, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
- $home_page = 1;
|
|
|
+ if ($userId != ""){
|
|
|
+ if (!CommonFn::isMongoId($userId)) {
|
|
|
+ $userId = new MongoId($userId);
|
|
|
}
|
|
|
+ Service::factory('CouponService')->giveCoupon($userId, $coupon_id, $start_time, $end_time);//发放代金券
|
|
|
+
|
|
|
}
|
|
|
- var_dump($home_page);
|
|
|
+
|
|
|
if($home_page){
|
|
|
$this->renderpartial('index');
|
|
|
}else{
|
|
@@ -119,7 +113,6 @@ class ActivityController extends O2oBaseController {
|
|
|
|
|
|
//检查微信登录页
|
|
|
public function actionWxIndex() {
|
|
|
-
|
|
|
$wxConfig = Yii::app()->params['wxConfig'];
|
|
|
$home_page = Yii::app()->getRequest()->getParam("home_page",'');
|
|
|
$coupon_id = Yii::app()->request->getParam('coupon_id', '');
|