绑定手机号相关和商品相关
This commit is contained in:
parent
f93afed82e
commit
bbea3f74ee
@ -37,6 +37,7 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface, L
|
|||||||
if ($name) {
|
if ($name) {
|
||||||
if (preg_match('/[\x{4e00}-\x{9fff}]+/u', $name) == 1) {
|
if (preg_match('/[\x{4e00}-\x{9fff}]+/u', $name) == 1) {
|
||||||
$where['%like%'] = ['store_name' => 'store_name'];
|
$where['%like%'] = ['store_name' => 'store_name'];
|
||||||
|
$where['='] = ['store_id', 'bar_code', 'cate_id'];
|
||||||
} else {
|
} else {
|
||||||
$where['='] = ['bar_code', 'cate_id'];
|
$where['='] = ['bar_code', 'cate_id'];
|
||||||
}
|
}
|
||||||
@ -79,20 +80,6 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface, L
|
|||||||
*/
|
*/
|
||||||
public function lists(): array
|
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');
|
$class_all = $this->request->get('class_all');
|
||||||
if ($class_all) {
|
if ($class_all) {
|
||||||
//查3级别的
|
//查3级别的
|
||||||
@ -127,19 +114,6 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface, L
|
|||||||
*/
|
*/
|
||||||
public function count(): int
|
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');
|
$class_all = $this->request->get('class_all');
|
||||||
if ($class_all) {
|
if ($class_all) {
|
||||||
//查3级别的
|
//查3级别的
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace app\api\logic\user;
|
namespace app\api\logic\user;
|
||||||
|
|
||||||
|
|
||||||
|
use app\api\service\UserTokenService;
|
||||||
use app\common\{logic\BaseLogic,
|
use app\common\{logic\BaseLogic,
|
||||||
model\dict\DictData,
|
model\dict\DictData,
|
||||||
model\finance\CapitalFlow,
|
model\finance\CapitalFlow,
|
||||||
@ -53,8 +54,15 @@ class UserLogic extends BaseLogic
|
|||||||
['id', '<>', $params['user_id']]
|
['id', '<>', $params['user_id']]
|
||||||
])->findOrEmpty();
|
])->findOrEmpty();
|
||||||
|
|
||||||
|
|
||||||
if (!$user->isEmpty()) {
|
if (!$user->isEmpty()) {
|
||||||
throw new \Exception('手机号已被其他账号绑定');
|
//切换被绑定账号删除该账号并且以新的账号登录
|
||||||
|
UserAuth::where('user_id',$params['user_id'])->update([
|
||||||
|
'user_id'=>$user['id']
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $user['id'];
|
||||||
|
// throw new \Exception('手机号已被其他账号绑定');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 绑定手机号
|
// 绑定手机号
|
||||||
|
Loading…
x
Reference in New Issue
Block a user