| | |
| | | $this->success([],'删除成功'); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 标记浏览0元购商品记录 |
| | | * |
| | |
| | | $this->success([],'添加成功'); |
| | | } |
| | | |
| | | /** |
| | | * 检测是否首单 |
| | | * |
| | | * @return void |
| | | */ |
| | | |
| | | public function check_isfirst_free() |
| | | { |
| | | |
| | | $LogicUserBrowse = new LogicUserBrowse(); |
| | | |
| | | $res = $LogicUserBrowse->checkIsFirstFree(USERID); |
| | | |
| | | if($res === false) $this->error($LogicUserBrowse->getError()); |
| | | |
| | | if(empty($res)) $this->success(['info'=>1],'首单客户'); |
| | | $this->success(['info'=>0],'非首单客户'); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用户收藏记录 |
| | |
| | | */ |
| | | public function updatefirstfreelog($user_id,$ids,$new_goodsId) |
| | | { |
| | | if(empty($ids)){ |
| | | if(empty($ids)||empty($new_goodsId)){ |
| | | fault('宝贝ID不能为空'); |
| | | return true; |
| | | } |
| | | $res=Db::name('user_browse')->where(['user_id'=>$user_id,'goodsId'=>$ids])->update(['is_free'=>1,'goodsId'=>$new_goodsId]); |
| | | //查询是否已经标记过 |
| | | $res=Db::query('SELECT id FROM t_user_first_free_browse WHERE user_id=? AND goodsId=?',[$user_id,$ids]); |
| | | if(!empty($res)){ |
| | | return true; |
| | | } |
| | | $res=Db::execute('INSERT INTO t_user_first_free_browse(user_id,goodsId,new_goodsId) VALUES (?,?,?)',[$user_id,$ids,$new_goodsId]); |
| | | |
| | | return true; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 查询是否首购 |
| | | * |
| | | * * @param [type] $user_id |
| | | * @param [type] $ids |
| | | * @return void |
| | | */ |
| | | |
| | | public function checkisfirstfree($user_id) |
| | | { |
| | | //查询是否已经标记过 |
| | | $res=Db::query('SELECT id FROM t_user_first_free_browse WHERE user_id=? AND is_order=?',[$user_id,1]); |
| | | return $res; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |