|
|
@@ -857,6 +857,28 @@ class User extends BaseController
|
|
857
|
857
|
}
|
|
858
|
858
|
|
|
859
|
859
|
/**
|
|
|
860
|
+ * 查询商品浏览记录以及删除
|
|
|
861
|
+ */
|
|
|
862
|
+ public function productHistory(){
|
|
|
863
|
+ $uid = $this->request->uid();
|
|
|
864
|
+ $list = Db::name('third_history')->where('uid', $uid)->order('create_time', 'desc')->limit(20)->column('keyword','id');
|
|
|
865
|
+ return app('json')->success(['count' => count($list), 'list' => $list]);
|
|
|
866
|
+ }
|
|
|
867
|
+ public function deleteProductHistory(){
|
|
|
868
|
+ $uid = $this->request->uid();
|
|
|
869
|
+ $id = $this->request->post('id');
|
|
|
870
|
+ $deleted = Db::name('third_history')
|
|
|
871
|
+ ->where('id', $id)
|
|
|
872
|
+ ->where('uid', $uid)
|
|
|
873
|
+ ->delete();
|
|
|
874
|
+ if ($deleted) {
|
|
|
875
|
+ return app('json')->success('删除成功');
|
|
|
876
|
+ } else {
|
|
|
877
|
+ return app('json')->fail('删除失败');
|
|
|
878
|
+ }
|
|
|
879
|
+ }
|
|
|
880
|
+
|
|
|
881
|
+ /**
|
|
860
|
882
|
* 签到 获取积分
|
|
861
|
883
|
* @return mixed
|
|
862
|
884
|
* @throws \think\db\exception\DataNotFoundException
|