Commit 692f28b4 authored by zhuwei's avatar zhuwei

1

parent e51f9e69
......@@ -125,7 +125,7 @@ class UserAgentService
public function moveHouseSaveData($page = 1,$limit = 100){
$field = "a.id as user_id,b.id as agent_id,a.site_ids as site_id,a.create_time";
$params[] = ['EXP', 'a.site_ids IS NOT NULL AND a.agent_id IS NOT NULL AND a.agent_id > 0'];
$user_list = $this->m_user->moveHouse($field, $params, $page, $limit, "a.id asc");
$user_list = $this->m_user->moveHouse($field, $params, $page, $limit, "a.id desc");
$user_list_ = [];
foreach ($user_list as $k => $v) {
$site_ids = explode(',', $v['site_id']);
......@@ -155,6 +155,39 @@ class UserAgentService
return true;
}
// public function moveHouseSaveDataV2($page = 1,$limit = 100){
// $field = "a.id as user_id,b.id as agent_id,a.site_ids as site_id,a.create_time";
// $params[] = ['EXP', 'a.site_ids IS NULL AND a.agent_id IS NOT NULL AND a.agent_id > 0'];
// $user_list = $this->m_user->moveHouse($field, $params, $page, $limit, "a.id asc");
// $user_list_ = [];
// foreach ($user_list as $k => $v) {
// $site_ids = explode(',', $v['site_id']);
// foreach ($site_ids as $k1 => $v1) {
// // dump($v1);exit;
// $a = [];
// $a['user_id'] = $v['user_id'];
// $a['site_id'] = $v1;
// $a['agent_id'] = $v['agent_id'];
// $a['create_time'] = $v['create_time'];
// $a['update_time'] = $v['create_time'];
// $user_list_[] = $a;
// }
// }
//
// foreach ($user_list_ as $k2 => $v2) {
// $is_save = $this->isSaveEd($v2['user_id'],$v2['agent_id'],$v2['site_id']);
// if($is_save){
// unset($user_list_[$k2]);
// }
// }
//
//
// if($user_list_){
// $user_insert = $this->m_user_agent->moveHouseInsertAll($user_list_);
// }
// return true;
// }
/**
* 查询当前关系是否已经存在
* @param $user_id
......
......@@ -1142,6 +1142,7 @@ class Users extends Model
->page($page)
->limit($limit)
->select();
// dump($this->getLastSql());exit;
return $result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment