协议列表

This commit is contained in:
“wanyongkang”
2024-02-29 17:35:18 +08:00
parent ea25ac7496
commit 72f43763b3

View File

@@ -72,4 +72,29 @@ class Index extends Controller
echo json_encode(['code' => 1,'msg'=>'上传成功']);
}
}
public function get_list() {
$get_data = json_decode(file_get_contents("php://input"), true);
$agreement_model = new AgreementModel;
$where = [];
$page = 0;
if (!empty($get_data['username'])) {
$where['username'] = $get_data['username'];
}
if (isset($get_data['PageIndex'])) {
$page = ($get_data['PageIndex'] - 1) * 50;
}
$list = $agreement_model->getListPage($where, '*', 'id desc', "$page,50");
$data = [
'Code' => 30000,
'Data' => $list,
'Message' => '',
'TotalCount' => (int)$agreement_model->getCount($where)['count'],
];
echo json_encode($data);
}
}