更新购物车数量
This commit is contained in:
parent
ec2b8b5661
commit
ea3a3dadc4
@ -147,10 +147,10 @@ class StoreCartDao extends BaseDao
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
*/
|
*/
|
||||||
public function getCartCount(int $uid,$product_type)
|
public function getCartCount(int $uid,$product_type,$source=0)
|
||||||
{
|
{
|
||||||
$data = ($this->getModel()::getDB())->where(['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type,'is_fail'=>0])->field('count(*) as count')->select();
|
$count = ($this->getModel()::getDB())->where(['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type,'is_fail'=>0,'source'=>$source])->count();
|
||||||
$data[0]['count'] = $data[0]['count'] ? $data[0]['count'] : 0;
|
$data[0]['count'] = $count;
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,9 +190,9 @@ class StoreCart extends BaseController
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
*/
|
*/
|
||||||
public function cartCount($product_type=0)
|
public function cartCount($product_type=0,$source=0)
|
||||||
{
|
{
|
||||||
return app('json')->success($this->repository->getCartCount($this->request->uid(),$product_type));
|
return app('json')->success($this->repository->getCartCount($this->request->uid(),$product_type,$source));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user