Browse Source

限制字段

master
李可松 4 years ago
parent
commit
822e90f38c
  1. 2
      app/Http/Controllers/Api/AgentProductController.php

2
app/Http/Controllers/Api/AgentProductController.php

@ -64,7 +64,7 @@ class AgentProductController extends Controller
} else { } else {
$where = ['id' => $id, 'agent_id' => $this->agent_id, 'status' => ProductStatus::ON_SALE]; $where = ['id' => $id, 'agent_id' => $this->agent_id, 'status' => ProductStatus::ON_SALE];
} }
$agent_product = AgentProduct::with(['coupon:tag,agent_product_id', 'product:id,type,extends', 'spec'])
$agent_product = AgentProduct::with(['coupon:tag,agent_product_id', 'product:id,type,extends', 'spec:id,name,date,stock,original_price,price'])
->whereDoesntHave('agentProductItem', function ($query) { ->whereDoesntHave('agentProductItem', function ($query) {
return $query->whereHas('product', function ($query) { return $query->whereHas('product', function ($query) {
return $query->where('stock', '<=', 0)->orWhere('status', '<>', ProductStatus::ON_SALE); return $query->where('stock', '<=', 0)->orWhere('status', '<>', ProductStatus::ON_SALE);

Loading…
Cancel
Save