Commit 99ec1201 authored by clone's avatar clone

1

parent 72fb6e35
......@@ -146,13 +146,13 @@ class SquareService
foreach ($list as $key => $item) {
$ids .= $key . ",";
}
$ids = rtrim($ids, ",");
$ids = strrev(rtrim($ids, ","));
$field = 'id,title,agent_id,district_lable_id,is_cream,cover_img,create_time';
$get_params['status'] = 0;
$get_params['id'] = array("in", $ids);
$res = $this->m_square->getSquare($field, $get_params);
$res = $this->m_square->getSquareBySort($field, $get_params,$ids);
foreach ($res as $key => $val) {
$agent = $this->redis->getRedisCache(2, $val['agent_id']);
......
......@@ -32,6 +32,18 @@ class BSquare extends Model
//dump($this->getLastSql());
return $result;
}
/**
* 查询数据
*/
public function getSquareBySort($field,$params,$ids)
{
$result = Db::table($this->table)
->field($field)
->where($params)
->order("FIELD(id,$ids)")
->select();
return $result;
}
public function getSquareList($pageNo,$pageSize,$field,$params)
{
......
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