绑定手机号相关和商品相关

This commit is contained in:
liu 2024-06-25 14:22:55 +08:00
parent f93afed82e
commit bbea3f74ee
2 changed files with 10 additions and 28 deletions

View File

@ -37,6 +37,7 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface, L
if ($name) {
if (preg_match('/[\x{4e00}-\x{9fff}]+/u', $name) == 1) {
$where['%like%'] = ['store_name' => 'store_name'];
$where['='] = ['store_id', 'bar_code', 'cate_id'];
} else {
$where['='] = ['bar_code', 'cate_id'];
}
@ -79,20 +80,6 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface, L
*/
public function lists(): array
{
$found = false;
if ($this->searchWhere) {
foreach ($this->searchWhere as $subArray) {
if (in_array('store_id', $subArray)) {
$found = true;
break; // 找到后退出循环
}
}
}
if (!$found) {
$store_id = DictType::where('type', 'store')->value('remark') ?? 5;
$this->searchWhere[] = ['store_id', '=', $store_id];
}
$class_all = $this->request->get('class_all');
if ($class_all) {
//查3级别的
@ -127,19 +114,6 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface, L
*/
public function count(): int
{
$found = false;
if ($this->searchWhere) {
foreach ($this->searchWhere as $subArray) {
if (in_array('store_id', $subArray)) {
$found = true;
break; // 找到后退出循环
}
}
}
if (!$found) {
$store_id = DictType::where('type', 'store')->value('remark') ?? 5;
$this->searchWhere[] = ['store_id', '=', $store_id];
}
$class_all = $this->request->get('class_all');
if ($class_all) {
//查3级别的

View File

@ -3,6 +3,7 @@
namespace app\api\logic\user;
use app\api\service\UserTokenService;
use app\common\{logic\BaseLogic,
model\dict\DictData,
model\finance\CapitalFlow,
@ -53,8 +54,15 @@ class UserLogic extends BaseLogic
['id', '<>', $params['user_id']]
])->findOrEmpty();
if (!$user->isEmpty()) {
throw new \Exception('手机号已被其他账号绑定');
//切换被绑定账号删除该账号并且以新的账号登录
UserAuth::where('user_id',$params['user_id'])->update([
'user_id'=>$user['id']
]);
return $user['id'];
// throw new \Exception('手机号已被其他账号绑定');
}
// 绑定手机号