海南旅游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.

28 lines
712 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. use Illuminate\Http\Request;
  7. class SpecialController extends Controller
  8. {
  9. //专题产品列表
  10. public function show()
  11. {
  12. $id = (int)request()->input('id');
  13. $detail = Special::query()
  14. ->select(['id', 'picture', 'picture_ad', 'updated_at', 'agent_product_id'])
  15. ->find($id);
  16. $detail->product = AgentProduct::query()
  17. ->whereIn('id', $detail->agent_product_id)
  18. ->select('id', 'sale', 'product_id', 'price', 'original_price')
  19. ->with('product:id,title,pictures')
  20. ->limit(6)->get();
  21. unset($detail->agent_product_id);
  22. return $this->success($detail);
  23. }
  24. }