Detail.php 688 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace app\controller\merchant;
  3. use app\model\hx\HxAgent;
  4. use support\Request;
  5. use support\Response;
  6. class Detail
  7. {
  8. public function getStoreData(Request $request): Response
  9. {
  10. try {
  11. $agentId = $request->user['agent_id'];
  12. if (empty($agentId)) return error("门店信息错误");
  13. $agent = (new HxAgent)->where('agent_id',$agentId)->field('name,vip_end,appid,account,status')->findOrEmpty();
  14. if ($agent->isEmpty()) return error("门店信息错误");
  15. return success('ok',$agent->toArray());
  16. } catch (\Throwable $throwable) {
  17. return error($throwable->getMessage());
  18. }
  19. }
  20. }