コード例 #1
0
 public function update(Request $request, $uid)
 {
     $user = WechatUser::find($uid);
     if (empty($user)) {
         return $this->failure_noexists();
     }
     $keys = 'type,content';
     $data = $this->autoValidate($request, 'wechat-message.store', $keys);
     //发送消息
     $media = null;
     if ($data['type'] == 'text') {
         $media = $data['content'];
     } else {
         if ($data['type'] == 'depot') {
             $media = WechatDepot::findOrFail($data['content']);
         } else {
             $media = Attachment::findOrFail($data['content']);
         }
     }
     (new Send($user))->add($media)->send();
     return $this->success();
 }
コード例 #2
0
ファイル: UserController.php プロジェクト: unionbt/hanpaimall
 public function update(Request $request, $id)
 {
     $user = WechatUser::find($id);
     if (empty($user)) {
         return $this->failure_noexists();
     }
     $keys = 'openid,nickname,gender,avatar_aid,country,province,city,language,unionid,remark,is_subscribed,subscribed_at,uid';
     $data = $this->autoValidate($request, 'wechat-user.store', $keys);
     $user->update($data);
     return $this->success();
 }
コード例 #3
0
ファイル: OAuth2.php プロジェクト: unionbt/hanpaimall
 public function getUser()
 {
     $wuid = Session::get('wechat-oauth2-' . $this->api->appid . '-user', NULL);
     $wuid = 15;
     return empty($wuid) ? false : WechatUser::find($wuid);
 }