Commit 45511a2a authored by zhuwei's avatar zhuwei

缓存获取站点名

parent 31073543
......@@ -9,6 +9,7 @@
namespace app\index\service;
use app\api_broker\service\RedisCacheService;
use app\model\Users;
use app\model\UserSiteModel;
......@@ -161,13 +162,18 @@ class UserSiteService
{
//查询总监下面门店的所有经纪人
$params = [];
$params["a.user_id"] = $user_id;
$field = 'b.city';
$params["user_id"] = $user_id;
$field = 'site_id';
$res = $this->m_user_site->getSiteNameList($field, $params);
$list_str = "";
if (count($res) > 0) {
$redis_cache = new RedisCacheService();
foreach ($res as $k => $v) {
$list_str .= $v["city"] . ",";
#缓存获取站点名
$redis_data = $redis_cache->getRedisCache(4, $v['site_id']);
if($redis_data)
$list_str .= $redis_data . ",";
}
$list_str = rtrim($list_str, ",");
}
......
......@@ -80,11 +80,9 @@ class UserSiteModel extends Model
*/
public function getSiteNameList($field,$params)
{
$params["a.is_del"] = 0;
$params["is_del"] = 0;
$result = $this->db_
->field($field)
->alias('a')
->join('a_site b', 'a.site_id = b.id', 'left')
->where($params)
->select();
//echo $this->getLastSql();
......
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