123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?php
- namespace App\Client;
- class Site
- {
- protected $site;
- public function __construct()
- {
- $this->site = app()->make('siteData');
- }
- /**
- * 获取用户id
- *
- * @return mixed
- */
- public function getUid()
- {
- return (int)getProp($this->site, 'uid');
- }
- /**
- * 获取用户channel_id
- *
- * @return mixed
- */
- public function getChannelId()
- {
- return (int)getProp($this->site, 'channel_id');
- }
- /**
- * 获取站点类型
- *
- * @return mixed
- */
- public function getChannelType()
- {
- return (string)getProp($this->site, 'channel_type');
- }
- /**
- * 获取站点充值模板id
- *
- * @return mixed
- */
- public function getChannelPayId()
- {
- return (int)getProp($this->site, 'channel_pay_id');
- }
- /**
- * 获取用户send_order_id
- *
- * @return mixed
- */
- public function getSendOrderId()
- {
- return (int)getProp($this->site, 'send_order_id');
- }
- /**
- * 获取用户from_uid
- *
- * @return mixed
- */
- public function getFromUid()
- {
- return (int)getProp($this->site, 'from_uid');
- }
- /**
- * 获取用户token
- *
- * @return mixed
- */
- public function getToken()
- {
- return (string)getProp($this->site, 'token');
- }
- /**
- * 获取用户account
- *
- * @return mixed
- */
- public function getAccount()
- {
- return (string)getProp($this->site, 'account');
- }
- /**
- * 获取用户phone
- *
- * @return mixed
- */
- public function getPhone()
- {
- return (string)getProp($this->site, 'phone');
- }
- /**
- * 获取用户阅读记录
- *
- * @return array
- */
- public function getRecentBooks()
- {
- return (array)getProp($this->site, 'recent_books');
- }
- /**
- * 获取当前阅读章节
- *
- * @return array
- */
- public function getCurrentChapter()
- {
- return (array)getProp($this->site, 'current_chapter');
- }
- /**
- * 获取当前阅读章节
- *
- * @return int
- */
- public function getRecentBid()
- {
- return (int)getProp($this->site, 'recent_bid');
- }
- /**
- * @return int
- */
- public function getCurrentChannelId()
- {
- return (int)getProp($this->site, 'current_channel_id');
- }
- /**
- * @return string
- */
- public function getCurrentChannelName()
- {
- return getProp($this->site, 'current_channel_name');
- }
- /**
- * 设置全局返回报错数据
- *
- * @param $data
- */
- public function setErrorResponseData($data)
- {
- $this->site->errorResponseData = $data;
- }
- /**
- * 获取全局返回报错数据
- *
- * @return mixed|string
- */
- public function getErrorResponseData()
- {
- return getProp($this->site, 'errorResponseData', []);
- }
- }
|