|
|
|
@ -1,6 +1,7 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace App\Http\Controllers\Api; |
|
|
|
use App\Common\ProductStatus; |
|
|
|
use App\Http\Controllers\Controller; |
|
|
|
use App\Models\AgentProduct; |
|
|
|
use App\Models\UserFav; |
|
|
|
@ -40,7 +41,7 @@ class AgentProductController extends Controller |
|
|
|
->with('product:id,title,pictures,know,stock,content') |
|
|
|
->with('coupon:tag,agent_product_id') |
|
|
|
->with('fav:agent_product_id') |
|
|
|
->firstWhere(['id' => $id, 'agent_id' => $this->agent_id, 'status' => 1]); |
|
|
|
->firstWhere(['id' => $id, 'agent_id' => $this->agent_id, 'status' => ProductStatus::ON_SALE]); |
|
|
|
|
|
|
|
if (!$agent_product || !$agent_product->product) { |
|
|
|
return $this->error('产品不存在或已下架'); |
|
|
|
|