提交 d2b0853b authored 作者: chengye's avatar chengye

添加project v2 接口

上级 49f73534
<?php
/**
* Created by PhpStorm.
* User: chouchou
* Date: 2020-6-21
* Time: 18:52
*/
namespace app\api\controller\v2\common;
class Project
{
public $jzdb;
protected function __construct()
{
$this->jzdb = Db::connect([
'type' => config('jz.jztype'),
'hostname' => config('jz.jzhostname'),
'database' => config('jz.jzdatabase'),
'username' => config('jz.jzusername'),
'password' => config('jz.jzpassword'),
'hostport' => config('jz.jzhostport'),
'charset' => config('jz.jzcharset'),
]);
}
public function project_list()
{
$data = request()->get();
$res = $this->checkKey($data['key']);
if ($res !== true) return json([
'code' => 201,
'message' => $res,
'data' => ''
]);
$project_code = $data['project_code'];
if (empty($project_code)) {
return json([
'code' => 202,
'message' => 'Not valid parameter',
]);
}
$map[] = ['project_code', '=', $project_code];
$datalist = $this->jzdb->table('jz_message')->field('project_code,jz_cur_dept')->where($map)->select();
return json([
'code' => 200,
'message' => 'SUCCESS',
'data' => $datalist,
]);
}
}
\ No newline at end of file
......@@ -34,4 +34,5 @@ Route::get('/v1/permission','api/v1.supplier.Assign/getDataPermission'); //获
//电费
Route::get('/v2/payment','api/v2.common.Payment/index'); //缴费接口
Route::get('/v2/payment/test','api/v2.common.Payment/test'); //缴费test接口
\ No newline at end of file
Route::get('/v2/payment/test','api/v2.common.Payment/test'); //缴费test接口
Route::get('/v2/project/list','api/v2.common.project/project_list'); //缴费test接口
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论