예제 #1
0
	public function add(){
		$Member_card_coupon_list = M("member_card_coupon")->where(array('token'=>$this->token,'attr'=>'0','is_delete'=>0,'type'=>1,'is_weixin'=>0))->count();
		if($Member_card_coupon_list < 1){
			$this->error('请先在会员卡中添加非微信优惠券!',U("User/Member_card/coupons"));
		}
		$Member_card_set_list = M("member_card_set")->where(array('token'=>$this->token))->field('id,cardname')->select();
		$this->assign("Member_card_set_list",$Member_card_set_list);
		if(IS_POST){
			$where_card_coupon['cardid'] = intval($_POST['cardid']);
			$where_card_coupon['token'] = $this->token;
			$save_card_coupon['is_huodong'] = 1;
			if($_POST['fist'] != ''){
				$where_card_coupon['id'] = intval($_POST['fist']);
				$up_card_coupon = M("member_card_coupon")->where($where_card_coupon)->save($save_card_coupon);
			}
			if($_POST['second'] != ''){
				$where_card_coupon['id'] = intval($_POST['second']);
				$up_card_coupon = M("member_card_coupon")->where($where_card_coupon)->save($save_card_coupon);
			}
			if($_POST['third'] != ''){
				$where_card_coupon['id'] = intval($_POST['third']);
				$up_card_coupon = M("member_card_coupon")->where($where_card_coupon)->save($save_card_coupon);
			}
			if($_POST['four'] != ''){
				$where_card_coupon['id'] = intval($_POST['four']);
				$up_card_coupon = M("member_card_coupon")->where($where_card_coupon)->save($save_card_coupon);
			}
			if($_POST['five'] != ''){
				$where_card_coupon['id'] = intval($_POST['five']);
				$up_card_coupon = M("member_card_coupon")->where($where_card_coupon)->save($save_card_coupon);
			}
			if($_POST['six'] != ''){
				$where_card_coupon['id'] = intval($_POST['six']);
				$up_card_coupon = M("member_card_coupon")->where($where_card_coupon)->save($save_card_coupon);
			}
			
		}
		parent::add(3);
	}
예제 #2
0
	public function add(){
		$rid = isset($_GET['researchid']) ? intval($_GET['researchid']) : 0;
		$data = M('Research')->where(array('id' => $rid, 'token' => $this->token))->find();
		if (empty($data)) {
			$this->redirect(U('Research/index'));
		}
		$this->assign('research', $data);
		parent::add(6);
	}
예제 #3
0
 public function add()
 {
     parent::add($this->lotteryType);
 }
예제 #4
0
 public function add()
 {
     parent::add(1);
 }