AdminController.php 778 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Http\Controllers\Traits\ApiResponseTrait;
  4. use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
  5. use Illuminate\Foundation\Bus\DispatchesJobs;
  6. use Illuminate\Foundation\Validation\ValidatesRequests;
  7. class AdminController extends Controller
  8. {
  9. use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
  10. use ApiResponseTrait;
  11. // 接口响应
  12. /**
  13. * 店铺基本信息
  14. * @var array
  15. */
  16. protected $shop = null;
  17. public function __construct()
  18. {
  19. }
  20. /**
  21. * 获取当前登陆用户权限ID
  22. * @return int|mixed
  23. */
  24. function getRoleId()
  25. {
  26. $admin_user = request()->admin_user;
  27. return empty($admin_user['role_id'])?0:$admin_user['role_id'];
  28. }
  29. }