Exemple #1
0
 function edit($uid)
 {
     $user = $this->model->get($uid, 'favoritedCoupons,favoritedShops');
     //			$cards = $this->model->get_user_cards($uid);
     //			$cards = $this->model->get_user_cards2($uid);
     $cards = $this->model2->get_all();
     //			$cards = $this->model2->get_all();
     if ($cards < 0) {
         $cards = 0;
     }
     $downloadedCoupons = $this->model->get_user_downloaded_coupons($uid);
     $data['title'] = '用户';
     $data['main'] = 'admin_users_edit';
     $data['model'] = $user;
     $data['favoritedCoupons'] = $user['favoritedCoupons'];
     $data['favoritedShops'] = $user['favoritedShops'];
     $data['cards'] = $cards;
     $data['downloadedCoupons'] = $downloadedCoupons;
     $this->load->view($this->config->item('admin_template'), $data);
 }
Exemple #2
0
 public function deleteMyFavoritedShopbranch_post()
 {
     $uid = $this->post('uid');
     $shopbranchId = $this->post('shopbranchId');
     $sessionToken = $this->post('sessionToken');
     if (empty($uid) || empty($shopbranchId) || empty($sessionToken)) {
         return $this->output_error(ErrorEmptyParameter);
     }
     $this->load->model('user2_m', 'user');
     if (!$this->user->isSessionValid($uid, $sessionToken)) {
         return $this->output_error(ErrorInvalidSession);
     }
     $this->db->query("delete from favoritedshopbranch where userId = {$uid} AND shopbranchId = {$shopbranchId}");
     return $this->output_success();
 }
Exemple #3
0
 public function test_get()
 {
     $response = $this->user->can_user_dcoupon(57, 36);
     // 		$response = $this->kqlibrary->get_union_user('13166361023');
     //   	$url = site_url($this->apiName."/batchDownloadUnionCoupon");
     //   	asyn_get($url);
     ////   	$url = "http://www.localhost";
     //   	$url = site_url();
     //   		$result = array('1'=>$this->kqlibrary->test());
     //   		$result = array('1'=>$url);
     //   		$this->user->g
     //   		$this->card->ge
     //   		$this->response($result);
     //   		$this->output_results($url);
     $this->output_results($response);
     //   	$this->output_success();
 }
Exemple #4
0
 public function test_send_notification($uid, $couponId)
 {
     $user = $this->user->get($uid);
     $completeTitle = $this->coupon->get_complete_title($couponId);
     //		var_dump($user);
     $mobile = $user['username'];
     $device = $user['device'];
     if ($device == 'iOS') {
         //			echo 'iOS';
         $sms = new Kqsms();
         $response = $sms->send_coupon_accepted_sms($mobile, $completeTitle);
         echo $response;
     } else {
         //			echo 'Android';
         $umengpush = new UmengPush();
         $title = '优惠券承兑完成';
         $text = "您的" . $completeTitle . "快券已使用,更多优惠在等着你哦!";
         $umengpush->send_customized_notification($uid, $title, $text);
     }
 }
Exemple #5
0
 function test_dcoupon($servername)
 {
     echo $this->user->download_coupon(32, 36, '222222');
 }