Commit 8b5b84bb authored by zhuwei's avatar zhuwei

操作记录

parent 995ac1c5
......@@ -18,6 +18,7 @@ use app\model\ABindingDevice;
use app\model\AStore;
use app\model\Evaluate;
use app\model\GHousesToAgents;
use app\model\GOperatingRecords;
use think\Session;
class Broker extends Basic
......@@ -815,4 +816,37 @@ class Broker extends Basic
return $this->response($code, $msg, $data);
}
/**
* 查询操作记录数据
* User: 朱伟
* Date: 2018-11-22
* Time: 14:55:27
*/
public function getRecordsList()
{
$params = $this->request->param();
$params = array(
"agents_id" => 6495
);
if (!isset($params["agents_id"])) {
return $this->response("101", "请求参数错误");
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field = 'OperatingRecords.id as OperatingRecords_id,';
$field .= 'OperatingRecords.name,';
$field .= 'OperatingRecords.remark,';
$field .= 'OperatingRecords.create_time';
$get_params['OperatingRecords.user_id'] = $params["agents_id"];
$get_params['OperatingRecords.type'] = 7;
$operatingRecords = new GOperatingRecords();
$res = $operatingRecords->getRecordsList($pageNo,$pageSize,$field,$get_params);
$res_total = $operatingRecords->getRecordsListTotal($field,$get_params);
return $this->response("200", "成功",['data'=>$res,'total'=>$res_total]);
}
}
\ No newline at end of file
......@@ -94,4 +94,41 @@ class GOperatingRecords extends BaseModel
->select();
return $data;
}
/**
* 查询数据
* 朱伟 2018-11-22 14:56:47
*/
public function getRecordsList($pageNo,$pageSize,$field,$params)
{
$order = "OperatingRecords.create_time desc";
$result = $this
->field($field)
->alias('OperatingRecords')
//->join('a_agents Agent', 'OperatingRecords.user_id = Agent.id', 'right')
->where($params)
->limit($pageSize)
->page($pageNo)
->order($order)
->select();
//dump($this->getLastSql());
return $result;
}
/**
* 查询数据统计
* 朱伟 2018-11-22 14:56:47
*/
public function getRecordsListTotal($field,$params)
{
$result = $this
->field($field)
->alias('OperatingRecords')
//->join('a_agents Agent', 'OperatingRecords.user_id = Agent.id', 'right')
->where($params)
->count();
//dump($this->getLastSql());
return $result;
}
}
\ No newline at end of file
......@@ -365,7 +365,9 @@ Route::group('index', [
'exportReportStore' => ['index/RankingList/exportReportStore', ['method' => 'GET|POST']],
'selectPkSortByTime' => ['index/RankingList/selectPkSortByTime', ['method' => 'GET|POST']],
'getRandKingListByAgentId' => ['index/RankingList/getRandKingListByAgentId', ['method' => 'GET|POST']],
'getStoreRandKingListByAgentId' => ['index/RankingList/getStoreRandKingListByAgentId', ['method' => 'GET|POST']],
'getStoreRandKingListByAgentId' => [ 'index/RankingList/getStoreRandKingListByAgentId', [ 'method' => 'GET|POST' ] ],
'getRecordsList' => [ 'index/broker/getRecordsList', [ 'method' => 'GET|POST' ] ],
]);
......
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