添加个人中心功能
This commit is contained in:
@@ -28,7 +28,7 @@ use think\facade\Hook;
|
||||
class CartLogic
|
||||
{
|
||||
//添加购物车
|
||||
public static function add($item_id, $goods_num, $user_id)
|
||||
public static function add($item_id, $goods_num, $user_id, $type)
|
||||
{
|
||||
$goods = Db::name('goods g')
|
||||
->field('i.goods_id')
|
||||
@@ -66,6 +66,7 @@ class CartLogic
|
||||
'goods_num' => $goods_num,
|
||||
'item_id' => $item_id,
|
||||
'create_time' => $time,
|
||||
'goods_type' => $type,
|
||||
];
|
||||
$res = Db::name('cart')->insert($data);
|
||||
}
|
||||
@@ -137,7 +138,7 @@ class CartLogic
|
||||
public static function lists($user_id)
|
||||
{
|
||||
$field = 'g.name,g.image,g.id as goods_id,g.status as g_status,g.del as g_del,
|
||||
i.spec_value_str,i.price,i.image as item_image,c.goods_num,c.selected,c.id as cart_id,c.item_id';
|
||||
i.spec_value_str,i.price,i.image as item_image,c.goods_num,c.selected,c.id as cart_id,c.item_id,c.goods_type';
|
||||
|
||||
$carts = Db::name('cart c')
|
||||
->field($field)
|
||||
|
||||
Reference in New Issue
Block a user