更新创建购物车类型
This commit is contained in:
parent
e64f991811
commit
153d4d7406
@ -644,7 +644,7 @@ class CommunityRepository extends BaseRepository
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function addCart($uid, $id)
|
||||
public function addCart($uid, $id, $resaleType=1)
|
||||
{
|
||||
$where = [
|
||||
$this->dao->getPk() => $id,
|
||||
@ -666,7 +666,7 @@ class CommunityRepository extends BaseRepository
|
||||
$data = [
|
||||
'uid' => $uid,
|
||||
'mer_id' => $item['mer_id'],
|
||||
'product_type' => 98,
|
||||
'product_type' => $resaleType == 1 ? 98 : 99,
|
||||
'product_id' => $item['product_id'],
|
||||
'product_attr_unique' => $item['product_attr_unique'],
|
||||
'cart_num' => $item['number'],
|
||||
|
@ -457,7 +457,8 @@ class Community extends BaseController
|
||||
public function addCart()
|
||||
{
|
||||
$communityId = $this->request->param('community_id');
|
||||
$cartIds = $this->repository->addCart($this->request->uid(), $communityId);
|
||||
$resaleType = $this->request->param('resale_type', 1);
|
||||
$cartIds = $this->repository->addCart($this->request->uid(), $communityId, $resaleType);
|
||||
return app('json')->success(['cart_id' => $cartIds]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user