| xqd
@@ -520,7 +520,7 @@ class AlbumController extends Controller
|
|
|
AlbumWatchRecord::create($add_record);
|
|
|
}
|
|
|
$goods = AlbumProductModel::where([['id',$goods_id],['store_id',$store_id]])->first();
|
|
|
- if(!empty($goods) && $userAuth->up_agent_id != 1){
|
|
|
+ if(!empty($goods) && $userAuth->is_dealer != 1){
|
|
|
$price = DB::table('album_product_price')->where([['agent_id',$userAuth->up_agent_id],['store_id',$store_id],['product_id',$goods['id']]])->first();
|
|
|
if(!empty($price)){
|
|
|
$goods->price = $price->price;
|
| xqd
@@ -541,6 +541,20 @@ class AlbumController extends Controller
|
|
|
$goods->is_favorite = 0;
|
|
|
$goods->favorite_id = '';
|
|
|
}
|
|
|
+ }elseif(!empty($goods) && $userAuth->is_dealer == 1){
|
|
|
+ $user_agent = AlbumAgentModel::where('user_id',$userAuth->id)->first();
|
|
|
+ $agent_id = $user_agent['id'];
|
|
|
+ $price = DB::table('album_product_price')->where([['agent_id',$agent_id],['store_id',$store_id],['product_id',$goods['id']]])->first();
|
|
|
+ if(!empty($price)){
|
|
|
+ $goods->price = $price->price;
|
|
|
+ $goods->mobile = $price->mobile;
|
|
|
+ $address = AlbumAgentModel::where('id',$userAuth->up_agent_id)->first();
|
|
|
+ $goods->address = $address;
|
|
|
+ }else{
|
|
|
+ $goods->price = '';
|
|
|
+ $goods->mobile = '';
|
|
|
+ $goods->address = '';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return $this->api($goods);
|