新增添加委托购物车

This commit is contained in:
yaooo 2023-09-07 11:14:09 +08:00
parent 0d50ea313d
commit 7bc8a15f70
2 changed files with 15 additions and 1 deletions

View File

@ -461,6 +461,20 @@ class Community extends BaseController
return app('json')->success(['cart_id' => $cartIds]);
}
/**
* 委托商品加购
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function addEntrustCart()
{
$communityId = $this->request->param('community_id');
$cartIds = $this->repository->addEntrustCart($this->request->uid(), $communityId);
return app('json')->success(['cart_id' => $cartIds]);
}
/**
* 转售商品列表
* @return mixed
@ -716,7 +730,6 @@ class Community extends BaseController
$list = $queryBuilder->setOption('field', [])->field(['c.community_id', 'c.uid', 'c.title', 'c.image', 'c.entrust_mer_id', 'm.credit_buy', 'm.settle_cycle', 'm.interest_rate', 'm.mer_name', 'm.mer_avatar', 'c.mer_status'])->order('c.community_id', 'desc')->page($page, $limit)->fetchSql(false)->select();
if ($list) $list = $list->toArray();
foreach($list as $k => $v) {
$list[$k]['mer_name'] = 0;
// type1发起的委托 2收到的委托
if ($type == 2) {
$merchantInfo = Db::name('merchant')->where('uid', $v['uid'])->find();

View File

@ -381,6 +381,7 @@ Route::group('api/', function () {
Route::post('/entrust', 'Community/entrust');
Route::get('/entrust/list', 'Community/entrustList');
Route::post('/entrust/check/:id', 'Community/checkEntrust');
Route::post('/entrust/addEntrustCart', 'Community/addEntrustCart');
})->prefix('api.community.');