|
@@ -111,7 +111,11 @@ class ShopController extends Controller {
|
|
|
public function getTokenShop(Request $request){
|
|
|
$data = JWTAuth::decode(JWTAuth::getToken())['shop'];
|
|
|
if($data->shop_id){
|
|
|
- return $this->jsonSuccess(Shop::where(['shop_id'=>$data->shop_id])->first());
|
|
|
+ $shop = Shop::where(['shop_id'=>$data->shop_id])->first();
|
|
|
+ $fractal = new Manager();
|
|
|
+ $res = new Item($shop,new ShopsTransformer());
|
|
|
+ $data = $fractal->createData($res)->toArray();
|
|
|
+ return $this->jsonSuccess($data);
|
|
|
}else{
|
|
|
return $this->jsonError('操作失败');
|
|
|
}
|