77 lines
2.1 KiB
PHP
77 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace app\agent\controller;
|
|
|
|
use fastphp\base\Controller;
|
|
use app\agent\model\AgentUser;
|
|
use app\agent\model\User as UserModel;
|
|
use app\agent\model\AgentScore as AgentScoreModel;
|
|
|
|
class Score extends Controller
|
|
{
|
|
//账号列表
|
|
public function getList ()
|
|
{
|
|
$get_data = $_GET;
|
|
$agent_id = $this->userinfo['OperaterID'];
|
|
$page = 0;
|
|
if (isset($_GET['PageIndex'])) {
|
|
$page = ($_GET['PageIndex'] - 1) * 50;
|
|
}
|
|
$where = [];
|
|
$where_str = '';
|
|
$where['agent_id'] = $agent_id;
|
|
|
|
if (!empty($_GET['Btime'])){
|
|
$date1 = date('Y-m-d', strtotime($_GET['Btime']));
|
|
$date2 = date('Y-m-d', strtotime($_GET['Etime']));
|
|
$where_str .= " UpdateTime>='" . $date1 . "' and UpdateTime<='" . $date2 . "' ";
|
|
}
|
|
|
|
|
|
|
|
$score_model = new AgentScoreModel;
|
|
$list = $score_model->getAgentListPage($where,$where_str, '*', 'id desc', "$page,50");
|
|
|
|
|
|
$data = [
|
|
'Code' => 10000,
|
|
'Data' => $list,
|
|
'Message' => '',
|
|
'TotalCount' => (int)$score_model->getCount($where)['count'],
|
|
];
|
|
echo json_encode($data);
|
|
}
|
|
|
|
//账号列表
|
|
public function getScoreList ()
|
|
{
|
|
$page = 0;
|
|
if (isset($_GET['PageIndex'])) {
|
|
$page = ($_GET['PageIndex'] - 1) * 50;
|
|
}
|
|
$where = [];
|
|
$where_str = '';
|
|
|
|
if (!empty($_GET['Btime'])){
|
|
$date1 = date('Y-m-d', strtotime($_GET['Btime']));
|
|
$date2 = date('Y-m-d', strtotime($_GET['Etime']));
|
|
$where_str .= " UpdateTime>='" . $date1 . "' and UpdateTime<='" . $date2 . "' ";
|
|
}
|
|
|
|
|
|
|
|
$score_model = new AgentScoreModel;
|
|
$list = $score_model->getAgentListPage($where,$where_str, '*', 'id desc', "$page,50");
|
|
|
|
|
|
$data = [
|
|
'Code' => 10000,
|
|
'Data' => $list,
|
|
'Message' => '',
|
|
'TotalCount' => (int)$score_model->getCount($where)['count'],
|
|
];
|
|
echo json_encode($data);
|
|
}
|
|
|
|
} |