查询委托商品详情
This commit is contained in:
parent
6db5974a19
commit
f4a1a74a25
@ -794,6 +794,27 @@ class Community extends BaseController
|
||||
return app('json')->success(compact('count', 'list'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 委托商品详情
|
||||
* @return mixed
|
||||
*/
|
||||
public function entrustDetail($id)
|
||||
{
|
||||
$communityInfo = Db::name('community')->where('community_id', $id)->where('is_del', 0)->find();
|
||||
if (!$communityInfo) {
|
||||
return app('json')->fail('委托商品不存在');
|
||||
}
|
||||
$uid = $this->request->uid();
|
||||
$communityInfo['mer_info'] = Db::name('merchant')->where('uid', $uid)->where('is_del', 0)->field(['mer_id', 'mer_name', 'mer_address', 'mer_avatar', 'settle_cycle', 'interest_rate'])->find();
|
||||
$communityInfo['entrust_mer_info'] = Db::name('merchant')->where('mer_id', $communityInfo['entrust_mer_id'])->where('is_del', 0)->field(['mer_id', 'mer_name', 'mer_address', 'mer_avatar'])->find();
|
||||
if (empty($communityInfo['mer_info']) || empty($communityInfo['entrust_mer_info'])) {
|
||||
return app('json')->fail('无权限查看委托商品');
|
||||
}
|
||||
$entrustDay = Db::name('entrust')->where('community_id', $id)->where('is_del', 0)->value('entrust_day');
|
||||
$communityInfo['entrust_day'] = $entrustDay;
|
||||
return app('json')->success($communityInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 供应链商家申请结束商品委托
|
||||
* @return mixed
|
||||
|
@ -382,6 +382,7 @@ Route::group('api/', function () {
|
||||
Route::get('/supplychain/list', 'Community/supplychainList');
|
||||
Route::post('/entrust', 'Community/entrust');
|
||||
Route::get('/entrust/list', 'Community/entrustList');
|
||||
Route::get('/entrust/:id', 'Community/entrustDetail');
|
||||
Route::post('/entrust/check/:id', 'Community/checkEntrust');
|
||||
Route::post('/entrust/addEntrustCart', 'Community/addEntrustCart');
|
||||
Route::post('/entrust/apply/finish/:id', 'Community/applyFinishEntrust');
|
||||
|
Loading…
x
Reference in New Issue
Block a user