1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Http\Controllers\QuickApp;
- use App\Modules\User\Models\User;
- use App\Modules\User\Services\QappUserService;
- use Illuminate\Routing\Controller;
- class BaseController extends Controller
- {
- private $field = [];
- public function __get($name)
- {
- if (!isset($this->field[$name])) {
- $qapp_user = (new QappUserService)->getGolableUser();
- if ($name == 'user_info') {
- $user = User::find($qapp_user->uid);
- $this->field[$name] = $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];
- }
- }
|