| xqd
@@ -403,6 +403,7 @@ class AlbumController extends Controller
|
|
|
public function albumGoods(Request $request)
|
|
|
{
|
|
|
$userAuth = Auth('api')->user();
|
|
|
+ if(!$userAuth) return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
|
|
|
$validator = Validator::make($request->all(), [
|
|
|
'cat_id' => 'required',
|
|
|
'store_id' => 'required',
|
| xqd
@@ -575,6 +576,7 @@ class AlbumController extends Controller
|
|
|
$ma = AlbumManufacturerModel::where('store_id',$store_id)->first();
|
|
|
$goods = AlbumProductModel::where([['id',$goods_id],['store_id',$store_id]])->first();
|
|
|
$address = AlbumAgentModel::where('id',$userAuth->up_agent_id)->first();
|
|
|
+
|
|
|
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)){
|
| xqd
@@ -610,10 +612,11 @@ class AlbumController extends Controller
|
|
|
$goods->realname = $ma->name;
|
|
|
$goods->avatar = $ma->avatar;
|
|
|
}else{
|
|
|
+ $agent = AlbumUserModel::where('id',$address->user_id)->first();
|
|
|
$goods->mobile = $address->phone;
|
|
|
$goods->address = $address->address;
|
|
|
$goods->realname = $address->name;
|
|
|
- $goods->avatar = $address->avatar;
|
|
|
+ $goods->avatar = $agent->avatar;
|
|
|
}
|
|
|
return $this->api($goods);
|
|
|
}
|