|
@@ -5,6 +5,7 @@ namespace app\data\controller\api;
|
|
|
use app\data\model\ShopGoods;
|
|
|
use app\data\model\ShopGoodsCart;
|
|
|
use app\data\model\ShopGoodsCate;
|
|
|
+use app\data\model\ShopGoodsCollection;
|
|
|
use app\data\model\ShopGoodsMark;
|
|
|
use app\data\service\ExpressService;
|
|
|
use app\data\service\GoodsService;
|
|
@@ -61,6 +62,11 @@ class Goods extends Auth
|
|
|
{
|
|
|
$this->success('获取区域成功', ExpressService::region(3, 1));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Title ("购物车添加")
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
public function cart_add()
|
|
|
{
|
|
|
$user = $this->getUser();
|
|
@@ -128,4 +134,28 @@ class Goods extends Auth
|
|
|
ShopGoodsCart::mk()->whereIn('id',$cart_id)->where('user_id',$user['id'])->delete();
|
|
|
$this->success('购物车已删除');
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @Title ("添加我的收藏")
|
|
|
+ */
|
|
|
+ public function collection(){
|
|
|
+ $user =$this->getUser();
|
|
|
+ $goods_id = input('goods_id');
|
|
|
+ ShopGoodsCollection::mk()->insertGetId(['uuid'=>$user['id'],'goods_id'=>$goods_id,'create_at'=>date('Y-m-d H:i:s')]);
|
|
|
+ $this->success('商品收藏成功');
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Title ("删除我的收藏")
|
|
|
+ */
|
|
|
+ public function del_collection(){
|
|
|
+ $user = $this->getUser();
|
|
|
+ $coll_ids = input('coll_ids');
|
|
|
+ ShopGoodsCollection::mk()->whereIn('id',$coll_ids)->where('uuid',$user['id'])->delete();
|
|
|
+ $this->success('商品收藏已取消');
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Title ("我的收藏列表")
|
|
|
+ */
|
|
|
+ public function collection_list(){
|
|
|
+
|
|
|
+ }
|
|
|
}
|