Пример #1
0
 /**
  * 显示移到至页面.
  *
  * @param $id
  *
  * @return mixed
  */
 public function getMoveTo($id)
 {
     // 粉丝原所在分组ID
     $groupid = $this->fanRepository->getFanGroupByfanId($id);
     //当前公众号的粉丝分组数据
     $options = get_wechat_options(\Session::get('account_id'));
     $app = new Application($options);
     $group = $app->user_group;
     //获取分组数据
     $groups = $group->lists()->groups;
     return user_view('fans.moveto')->with(['groupid' => $groupid, 'groups' => $groups]);
 }
Пример #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $options = get_wechat_options();
     $app = new Application($options);
     $luckyMoney = $app['lucky_money'];
     $data['mch_billno'] = '133134546546';
     $data['send_name'] = '测试';
     $data['re_openid'] = '133134546546';
     $data['total_amount'] = '1000';
     $data['total_num'] = 1;
     $data['wishing'] = 'wishing';
     $data['client_ip'] = '192.168.0.245';
     $data['act_name'] = 'test act';
     $data['remark'] = 'remark';
     $data['hb_type'] = 'NORMAL';
     $res = $luckyMoney->prepare($data);
     //        $res = $luckyMoney->sendGroup($data);
     dump($res);
 }
Пример #3
0
 /**
  * 提交菜单到微信
  *
  * @param AccountModel $account
  */
 public function saveToRemote($account)
 {
     $menus = $this->menuRepository->menuTree()->toArray();
     $options = get_wechat_options($account->id);
     $easywechat = new Application($options);
     $menus = $this->formatToWechat($menus);
     return $easywechat->menu->add($menus);
 }
Пример #4
0
 /**
  * 处理用户关注事件消息.
  *
  * @param AccountModel $account
  * @param              $message
  *
  * @return Response
  */
 private function handleSubscribe(AccountModel $account, $message)
 {
     // 请用户关注,用户数据添加至本地数据库
     // 获取微信相关设置参数
     $options = get_wechat_options($account->id);
     $easywechat = new Application($options);
     $userInfo = $easywechat->user->get($message->FromUserName);
     $userInfo['account_id'] = $account->id;
     $fanService = app(Fan::class);
     $fanService->create($userInfo->toArray());
     // 查询设置的默认回复数据
     $reply = $this->replyRepository->skipCriteria()->getSubscribeReply($account->id);
     return $this->messageService->makeText($reply['content']);
 }