コード例 #1
0
 public function opposition()
 {
     $id = $_REQUEST['id'];
     $str = $_REQUEST['str'];
     $user_id = $_REQUEST['user_id'];
     if (!empty($str) && !empty($id)) {
         $user_bill = M('UserBill');
         $data['id'] = $id;
         $data['opposition_reason'] = $str;
         $re = $user_bill->save($data);
         if ($re) {
             //数据更新成功后,推送消息
             $user = M('User');
             $userInfo = $user->field('id,device_type,device_id')->where('id=' . $user_id)->find();
             //推送消息
             $title = "交易提醒";
             $type = 1;
             $description = "交易被拒绝,原因:" . $str;
             $user_id = $userInfo['device_id'];
             $device_type = $userInfo['device_type'];
             parent::push($user_id, $device_type, $title, $description, $type, 'customer');
         }
         $this->assign('jumpUrl', U("CustomersPayFor/"));
         $this->success('反对成功!');
     } else {
         $this->error('非法操作!');
     }
 }
コード例 #2
0
ファイル: AllOrderAction.class.php プロジェクト: ycltpe/sig
 public function confirm()
 {
     $id = $_REQUEST['id'];
     $footprints = M('Footprints');
     $footInfo = $footprints->field('id,user_id,rebate')->where('id=' . $id)->find();
     if (!empty($footInfo)) {
         //查询用户信息
         $user = M('User');
         $re = $user->setInc('cahsback', 'id=' . $footInfo['user_id'], $footInfo['rebate']);
         $log = new Log();
         $log->write($user->getLastSql());
         if ($re) {
             $data['id'] = $id;
             $data['status'] = 4;
             $data['type'] = 4;
             $data['update_time'] = time();
             $res = $footprints->save($data);
             if ($res) {
                 //推送给顾客
                 $user = M('User');
                 $userInfo = $user->field('id,device_type,device_id')->where('id=' . $footInfo['user_id'])->find();
                 //推送消息
                 $title = "回扣提醒";
                 $type = 3;
                 $description = "您的订单已经回扣成功!";
                 $user_id = $userInfo['device_id'];
                 $device_type = $userInfo['device_type'];
                 parent::push($user_id, $device_type, $title, $description, $type, 'customer');
                 $this->assign('jumpUrl', U("WaitingForTheRebate/"));
                 $this->success('回扣成功!');
             } else {
                 $this->error('回扣失败!');
             }
         } else {
             $this->error('回扣失败!');
         }
     } else {
         $this->error('回扣失败!');
     }
 }
コード例 #3
0
ファイル: AllUserAction.class.php プロジェクト: ycltpe/sig
 public function push_auth($user_id, $is_auth)
 {
     $user = M('User');
     $userInfo = $user->field('id,device_type,device_id')->where('id=' . $user_id)->find();
     //推送消息
     $title = "认证提醒";
     if ($is_auth) {
         $type = 4;
         $description = "恭喜!您的信息已被认证通过!";
     } else {
         $type = 5;
         $description = "抱歉!您的信息未通过认证!";
     }
     $user_id = $userInfo['device_id'];
     $device_type = $userInfo['device_type'];
     parent::push($user_id, $device_type, $title, $description, $type, 'customer');
 }