Commit 3c2f8364 authored by hujun's avatar hujun

模型方法名修改

parent a147d46d
...@@ -83,7 +83,7 @@ class Agent extends Basic ...@@ -83,7 +83,7 @@ class Agent extends Basic
['a_store s', ' a.store_id=a.id','left'], ['a_store s', ' a.store_id=a.id','left'],
['a_district d','a.district_id=d.id','left'] ['a_district d','a.district_id=d.id','left']
]; ];
$data['list'] = $table->getList($pageNo, $pageSize,$order,$field,$join, $where); $data['list'] = $table->getListJoin($pageNo, $pageSize,$order,$field,$join, $where);
$data['total'] = $table->getTotal2($where); $data['total'] = $table->getTotal2($where);
// prt($list);//转化arr // prt($list);//转化arr
//prt(collection($list)->toArray());//转化arr //prt(collection($list)->toArray());//转化arr
......
...@@ -16,6 +16,9 @@ use app\model\GHousesToAgents; ...@@ -16,6 +16,9 @@ use app\model\GHousesToAgents;
class Broker extends Basic class Broker extends Basic
{ {
protected $code = 200;
protected $data = '';
protected $msg = '';
/** /**
* 获取经纪人列表 * 获取经纪人列表
...@@ -72,7 +75,7 @@ class Broker extends Basic ...@@ -72,7 +75,7 @@ class Broker extends Basic
if ($where) { if ($where) {
$agent = new AAgents(); $agent = new AAgents();
$field = 'id,name,phone'; $field = 'id,name,phone';
$data['data'] = $agent->getList($pageNo, $pageSize, '', $field, $where); $data['data'] = $agent->getListJoin($pageNo, $pageSize, '', $field, $where);
} else { } else {
$data['msg'] = '没有经纪人信息'; $data['msg'] = '没有经纪人信息';
} }
...@@ -166,4 +169,20 @@ class Broker extends Basic ...@@ -166,4 +169,20 @@ class Broker extends Basic
} }
return $this->response($data['status'], $data['msg'], $data['data']); return $this->response($data['status'], $data['msg'], $data['data']);
} }
/**
* 总监列表
*
* @return \think\Response
*/
public function getDistrictList () {
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$agents = new AAgents();
$field = 'id,name,create_time,phone';
$where['level'] = ['IN','30,40'];
$where['status'] = 0;
$this->data = $agents->getList($pageNo, $pageSize, '', $field, '',$where);
return $this->response($this->code, $this->msg, $this->data);
}
} }
\ No newline at end of file
...@@ -17,7 +17,7 @@ public function saveList(){ ...@@ -17,7 +17,7 @@ public function saveList(){
} }
//分页列表 //分页列表
public function getList($p = 1, $pageSize = 15, $order_ = 'id desc', $field = '',$join='', $where = '') public function getListJoin($p = 1, $pageSize = 15, $order_ = 'id desc', $field = '',$join='', $where = '')
{ {
$data = $this->field($field) $data = $this->field($field)
->alias('a') ->alias('a')
......
...@@ -165,27 +165,7 @@ class AuthGroup extends BaseModel ...@@ -165,27 +165,7 @@ class AuthGroup extends BaseModel
public function checkGroupId($gid){ public function checkGroupId($gid){
return $this->checkId('AuthGroup',$gid, '以下用户组id不存在:'); return $this->checkId('AuthGroup',$gid, '以下用户组id不存在:');
} }
/**
* 返回角色分组
*
* @param type $pageNo
* @param type $pageSize
* @param type $order_
* @param type $field
* @param type $params
* @return type
*/
public function getList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
return $this->field($field)
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
public function getList2( $order_ = 'id desc', $field = '', $params = '') { public function getList2( $order_ = 'id desc', $field = '', $params = '') {
return $this->field($field) return $this->field($field)
->where($params) ->where($params)
......
...@@ -121,6 +121,7 @@ Route::group('index', [ ...@@ -121,6 +121,7 @@ Route::group('index', [
'editExclusive' => ['index/houses/editExclusive', ['method' => 'post']], //添加和编辑楼盘独家 'editExclusive' => ['index/houses/editExclusive', ['method' => 'post']], //添加和编辑楼盘独家
'getExclusive' => ['index/houses/getExclusive', ['method' => 'get']], //获取楼盘独家 'getExclusive' => ['index/houses/getExclusive', ['method' => 'get']], //获取楼盘独家
'getRecords' => ['index/houses/getRecords',['method'=>'get']], //操作记录 'getRecords' => ['index/houses/getRecords',['method'=>'get']], //操作记录
'getDistrictList' => ['index/broker/getDistrictList',['method'=>'get']], //总监列表
]); ]);
......
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