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.
|
|
<?php
namespace App\Http\Controllers\Api;use App\Http\Controllers\Controller;use App\Models\AgentProduct;use App\Models\Special;
class SpecialController extends Controller{ //专题产品列表
public function show() { $id = (int)request()->input('id'); $detail = Special::query() ->select(['id', 'picture', 'picture_ad', 'updated_at', 'agent_product_id']) ->find($id);
$detail->product = AgentProduct::list() ->where('agent_id', $this->agent_id) ->whereIn('id', $detail->agent_product_id) ->limit(6)->get(); unset($detail->agent_product_id);
return $this->success($detail); }}
|