Merge pull request '更新用户区域选择' (#29) from fix_store_user into main

Reviewed-on: #29
This commit is contained in:
mkm 2024-07-02 11:59:57 +08:00
commit be32e704c3
2 changed files with 24 additions and 2 deletions

View File

@ -0,0 +1,13 @@
<?php
namespace app\common\model\user_ship;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
class UserShip extends BaseModel
{
use SoftDelete;
protected $name = 'user_ship';
protected $deleteTime = 'delete_time';
}

View File

@ -8,8 +8,9 @@ use app\common\model\store_finance_flow\StoreFinanceFlow;
use app\common\model\user_sign\UserSign;
use app\store\lists\BaseAdminDataLists;
use app\common\model\user\User;
use app\common\model\user\UserShip;
use app\common\model\user_ship\UserShip;
use app\common\lists\ListsSearchInterface;
use app\common\model\user\UserAddress;
class UserLists extends BaseAdminDataLists implements ListsSearchInterface
{
@ -38,7 +39,15 @@ class UserLists extends BaseAdminDataLists implements ListsSearchInterface
*/
public function lists(): array
{
$street=$this->request->get('street','');
if($street){
$uid=UserAddress::where('street',$street)->group('uid')->column('uid');
if($uid){
$this->searchWhere[]=['id','in',$uid];
}else{
return [];
}
}
$field = "id,nickname,real_name,sex,avatar,account,mobile,now_money,user_ship,create_time,purchase_funds,integral";
$lists = User::where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)