BaseController.php 988 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Http\Controllers\QuickApp;
  3. use App\Modules\User\Services\QappUserService;
  4. use Illuminate\Routing\Controller;
  5. class BaseController extends Controller
  6. {
  7. private $field = [];
  8. public function __get($name)
  9. {
  10. // if (!isset($this->field[$name])) {
  11. // $qapp_user = QappUserService::getGolableUserStatic();
  12. // if ($name == '_user_info') {
  13. // $this->field[$name] = $qapp_user->user;
  14. // }
  15. // if ($name == 'uid') {
  16. // $this->field[$name] = $qapp_user->uid;
  17. // }
  18. // if ($name == 'distribution_channel_id') {
  19. // $this->field[$name] = $qapp_user->user->distribution_channel_id;
  20. // }
  21. // }
  22. if (!isset($this->field[$name])) {
  23. $this->field['_user_info'] = '';
  24. $this->field['uid'] = 1;
  25. $this->field['distribution_channel_id'] = 5;
  26. }
  27. return $this->field[$name];
  28. }
  29. }