From eaca947882711ccec82976f4e70ff21398556b63 Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期四, 06 七月 2023 15:23:50 +0800
Subject: [PATCH] no message

---
 application/api/logic/UserBrowse.php |   42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/application/api/logic/UserBrowse.php b/application/api/logic/UserBrowse.php
index ee82170..8f4921a 100644
--- a/application/api/logic/UserBrowse.php
+++ b/application/api/logic/UserBrowse.php
@@ -4,7 +4,7 @@
 use app\common\logic\Basic as BasicLogic;
 use app\common\model\user\Browse as ModelUserBrowse;
 use app\api\logic\taoke\device\Jd as LogicJd;
-
+use think\Db;
 
 class UserBrowse extends BasicLogic
 {
@@ -73,6 +73,46 @@
 
     }
 
+    /**
+     * 鏍囪娴忚0鍏冭喘鍟嗗搧璁板綍
+     *
+     * * @param [type] $user_id
+     * @param [type] $ids
+     * @return void
+     */
+    public function updatefirstfreelog($user_id,$ids,$new_goodsId,$plateform)
+    {
+        if(empty($ids)||empty($new_goodsId)){
+            fault('瀹濊礉ID涓嶈兘涓虹┖');
+            return true;
+        }
+        //鏌ヨ鏄惁宸茬粡鏍囪杩�
+        $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,plateform) VALUES (?,?,?,?)',[$user_id,$ids,$new_goodsId,$plateform]);
+
+        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;
+
+    }
+
 
    
 

--
Gitblit v1.9.3