更新购物车列表
This commit is contained in:
parent
21d278537c
commit
ec2b8b5661
@ -69,9 +69,9 @@ class StoreCartDao extends BaseDao
|
||||
* @param int $uid
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAll(int $uid,$product_type)
|
||||
public function getAll(int $uid,$product_type,$source=0)
|
||||
{
|
||||
$query = ($this->getModel())::where(['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type])
|
||||
$query = ($this->getModel())::where(['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type,'source'=>$source])
|
||||
->with([
|
||||
'product' => function ($query) {
|
||||
$query->field('product_id,image,store_name,is_show,status,is_del,unit_name,price,mer_status,is_used,product_type,once_max_count,once_min_count,pay_limit,mer_svip_status,svip_price_type');
|
||||
|
@ -45,9 +45,9 @@ class StoreCartRepository extends BaseRepository
|
||||
* @return array
|
||||
* @author Qinii
|
||||
*/
|
||||
public function getList($user,$product_type)
|
||||
public function getList($user,$product_type,$source=0)
|
||||
{
|
||||
$res = $this->dao->getAll($user->uid,$product_type)->append(['checkCartProduct', 'UserPayCount', 'ActiveSku', 'attrValue', 'attr','spu']);
|
||||
$res = $this->dao->getAll($user->uid,$product_type,$source)->append(['checkCartProduct', 'UserPayCount', 'ActiveSku', 'attrValue', 'attr','spu']);
|
||||
$make = app()->make(ProductRepository::class);
|
||||
$res->map(function ($item) use ($make) {
|
||||
$item['attr'] = $make->detailAttr($item['attr']);
|
||||
|
@ -56,10 +56,10 @@ class StoreCart extends BaseController
|
||||
* @Date: 2020/5/28
|
||||
* @return mixed
|
||||
*/
|
||||
public function lst($product_type=0)
|
||||
public function lst($product_type=0,$source=0)
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
return app('json')->success($this->repository->getList($this->request->userInfo(),$product_type));
|
||||
return app('json')->success($this->repository->getList($this->request->userInfo(),$product_type,$source));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user