From 8098c9ed85b4431cd52fe8695c8dc049b44a4e51 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Fri, 29 Mar 2024 23:00:38 +0800 Subject: [PATCH 1/6] 1 --- app/common/model/Goods.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/common/model/Goods.php b/app/common/model/Goods.php index 57040f64..a6e996b8 100644 --- a/app/common/model/Goods.php +++ b/app/common/model/Goods.php @@ -479,6 +479,7 @@ class Goods extends BaseModel if (isset($param['profit_rate_max']) && $param['profit_rate_max'] !== '') { $filter[] = ['goods.profit_rate', '<=', $params['profit_rate_max']]; } + $filter[] = ['is_delete', '=', 0]; // 实例化新查询对象 return $query->where($filter); } From ceb7fa50995584c2b26680cdfe953548914ee443 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Fri, 29 Mar 2024 23:02:13 +0800 Subject: [PATCH 2/6] 1 --- app/common/model/Goods.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/model/Goods.php b/app/common/model/Goods.php index a6e996b8..a853c4d1 100644 --- a/app/common/model/Goods.php +++ b/app/common/model/Goods.php @@ -479,7 +479,7 @@ class Goods extends BaseModel if (isset($param['profit_rate_max']) && $param['profit_rate_max'] !== '') { $filter[] = ['goods.profit_rate', '<=', $params['profit_rate_max']]; } - $filter[] = ['is_delete', '=', 0]; + $filter[] = ['goods.is_delete', '=', 0]; // 实例化新查询对象 return $query->where($filter); } From c2391a4097abe2554fdf0a5a843f4f4a7912dcdc Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Sat, 30 Mar 2024 00:00:23 +0800 Subject: [PATCH 3/6] 1 --- app/common/model/Goods.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/common/model/Goods.php b/app/common/model/Goods.php index a853c4d1..e4f2cb9f 100644 --- a/app/common/model/Goods.php +++ b/app/common/model/Goods.php @@ -312,8 +312,7 @@ class Goods extends BaseModel //关键字搜索 wanghousheng if (!empty($param['keyword'])) { - $query = $query->where('goods_name', 'like', "%{$param['keyword']}%") - ->whereOr('goods_no', 'like', "%{$param['keyword']}%"); + $query = $query->whereRaw('goods_name like ? or goods_no like ?', ["%{$param['keyword']}%", "%{$param['keyword']}%"]); } // 执行查询 $list = $query->with(['images.file']) @@ -479,7 +478,6 @@ class Goods extends BaseModel if (isset($param['profit_rate_max']) && $param['profit_rate_max'] !== '') { $filter[] = ['goods.profit_rate', '<=', $params['profit_rate_max']]; } - $filter[] = ['goods.is_delete', '=', 0]; // 实例化新查询对象 return $query->where($filter); } From 1a17477822d171857fe36751f21b2889bcdd351f Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Sat, 30 Mar 2024 15:18:14 +0800 Subject: [PATCH 4/6] 1 --- app/api/service/passport/Login.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/service/passport/Login.php b/app/api/service/passport/Login.php index 49e7f983..425922b6 100644 --- a/app/api/service/passport/Login.php +++ b/app/api/service/passport/Login.php @@ -330,7 +330,7 @@ class Login extends BaseService return; } // 推荐人ID - $refereeId = (int)$data['refereeId'] ?? null; + $refereeId = !empty($data['refereeId']) ?? null; // 用户不存在: 创建一个新用户 $this->createUser($data['mobile'], $data['isParty'], $data['partyData'], $refereeId); } From ace6870a4dc0426871ae66ce9e9acda62073d226 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Sat, 30 Mar 2024 15:30:47 +0800 Subject: [PATCH 5/6] 1 --- app/api/service/passport/Login.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/service/passport/Login.php b/app/api/service/passport/Login.php index 425922b6..3f7448d8 100644 --- a/app/api/service/passport/Login.php +++ b/app/api/service/passport/Login.php @@ -24,7 +24,6 @@ use app\common\enum\Setting as SettingEnum; use app\common\service\BaseService; use cores\exception\BaseException; use think\facade\Cache; -use yiovo\captcha\facade\CaptchaApi; /** * 服务类:用户登录 @@ -330,7 +329,10 @@ class Login extends BaseService return; } // 推荐人ID - $refereeId = !empty($data['refereeId']) ?? null; + $refereeId = 0; + if (!empty($data['refereeId'])) { + $refereeId = intval($data['refereeId']); + } // 用户不存在: 创建一个新用户 $this->createUser($data['mobile'], $data['isParty'], $data['partyData'], $refereeId); } From 7224543b1cee7b793c6a1302a3dc1517ef6c5f40 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Sat, 30 Mar 2024 16:01:29 +0800 Subject: [PATCH 6/6] 11 --- app/api/service/passport/Login.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/api/service/passport/Login.php b/app/api/service/passport/Login.php index 3f7448d8..ee6dad14 100644 --- a/app/api/service/passport/Login.php +++ b/app/api/service/passport/Login.php @@ -24,6 +24,7 @@ use app\common\enum\Setting as SettingEnum; use app\common\service\BaseService; use cores\exception\BaseException; use think\facade\Cache; +use yiovo\captcha\facade\CaptchaApi; /** * 服务类:用户登录