public function updateAction()
 {
     $setPacketM = new SetRedpacketModel();
     $data = $setPacketM->create();
     $data['id'] = I('post.id');
     $data['old_state'] = I('post.old_state', 0);
     $data['new_state'] = I('post.new_state', 0);
     $data['old_min_value'] = huansuan(I('post.old_min_value'));
     $data['old_max_value'] = huansuan(I('post.old_max_value'));
     $data['new_min_value'] = huansuan(I('post.new_min_value'));
     $data['new_max_value'] = huansuan(I('post.new_max_value'));
     $data['old_max_num'] = I('post.old_max_num');
     $data['attention_give'] = I('post.attention_give', 0);
     $data['wishing'] = trim(I('post.wishing'));
     $data['share_url'] = trim(I('post.share_url'));
     $setPacketM->save($data);
     $urlIndex = U('Active/SendRedGift/index');
     redirect_url($urlIndex);
 }
Пример #2
0
 public function savePayedInfo($data)
 {
     $map['id'] = $data['id'];
     $res = $this->where($map)->find();
     if ($res['state'] == 1) {
         return '订单已支付,请务重复提交';
     } else {
         $data['real_pay'] = huansuan($data['real_pay']);
         $data['state'] = 1;
         $this->save($data);
         return true;
     }
 }
 function toChange($id)
 {
     $map['id'] = $id;
     $payable = I('post.payable');
     $data['payable'] = huansuan($payable);
     $this->where($map)->save($data);
     $resData['status'] = 'success';
     $resData['msg'] = ' 操作成功';
     return $resData;
 }
Пример #4
0
 public function addCouponAction()
 {
     $count = I('post.count');
     $data['cover'] = huansuan(I('post.cover'));
     $data['duration'] = I('post.duration');
     $data['start_time'] = time();
     $data['end_time'] = time() + I('post.duration') * 24 * 60 * 60;
     $data['openid'] = I('post.openid');
     $active = M("coupon");
     for ($i = 0; $i < $count; $i++) {
         $active->add($data);
     }
     $urlIndex = U('Active/Index/sort');
     redirect_url($urlIndex);
 }
Пример #5
0
 public function update($key)
 {
     if ($key == 0) {
         $rebate = M('rebate');
         $data = array();
         $data[id] = I('post.id');
         $data[top_money] = huansuan(I('post.top_money'));
         $data[direct_ratio] = I('post.direct_ratio');
         $rebate->save($data);
     } else {
         $rebate = M('rebate');
         $data = array();
         $data[id] = I('post.id');
         $data[top_money] = huansuan(I('post.top_money'));
         $data[line_ratio] = I('post.line_ratio');
         $rebate->save($data);
     }
 }