12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace App\Http\Controllers\QuickApp;
- use App\Modules\User\Models\User;
- use App\Modules\User\Services\QappUserService;
- use Illuminate\Routing\Controller;
- /**
- * @property User $user_info 用户基本信息
- * @property int $uid
- * @property string $phone 手机号
- * @property int $distribution_channel_id 渠道号ID
- * @property int $send_order_id 派单ID
- * @property int $app_pay_merchat_id 微信app支付通道ID
- * @property int $h5_pay_merchat_id 微信h5支付通道ID
- * @property int $ali_pay_merchat_id 支付宝支付通道ID
- */
- class BaseController extends Controller
- {
- private $field = [];
- public function __get($name)
- {
- if (!isset($this->field[$name])) {
- $qapp_user = QappUserService::getGolableUserStatic();
- if ($name == 'user_info') {
- $this->field[$name] = $qapp_user->user;
- }
- if ($name == 'uid') {
- $this->field[$name] = $qapp_user->uid;
- }
- if ($name == 'phone') {
- $this->field[$name] = $qapp_user->phone;
- }
- if ($name == 'distribution_channel_id') {
- $this->field[$name] = $qapp_user->user->distribution_channel_id;
- }
- if ($name == 'send_order_id') {
- $this->field[$name] = $qapp_user->send_order_id;
- }
- if ($name == 'app_pay_merchat_id') {
- $this->field[$name] = $qapp_user->app_pay_merchat_id;
- }
- if ($name == 'h5_pay_merchat_id') {
- $this->field[$name] = $qapp_user->h5_pay_merchat_id;
- }
- if ($name == 'ali_pay_merchat_id') {
- $this->field[$name] = $qapp_user->ali_pay_merchat_id;
- }
- }
- return $this->field[$name];
- }
- }
|