海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
616 B

  1. <?php
  2. namespace App\Http\Controllers\Api;
  3. use App\Http\Controllers\Controller;
  4. use App\Models\AgentProduct;
  5. use App\Models\Special;
  6. class SpecialController extends Controller
  7. {
  8. //专题产品列表
  9. public function show()
  10. {
  11. $id = (int)request()->input('id');
  12. $detail = Special::query()
  13. ->select(['id', 'picture', 'picture_ad', 'updated_at', 'agent_product_id'])
  14. ->find($id);
  15. $detail->product = AgentProduct::list()
  16. ->where('agent_id', $this->agent_id)
  17. ->whereIn('id', $detail->agent_product_id)
  18. ->limit(6)->get();
  19. unset($detail->agent_product_id);
  20. return $this->success($detail);
  21. }
  22. }