Commit 1e0bea43 authored by zhuwei's avatar zhuwei

addOffice

parent f4b47403
......@@ -27,7 +27,7 @@ class StoreFee extends Basic
* 新增数据
* @return \think\Response
*/
public function addFeeOffice()
public function addOffice()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
......@@ -37,18 +37,18 @@ class StoreFee extends Basic
"office_name" => '鳖',//办公室名
"office_address" =>'上海市黄浦区龙华东路800号',//办公室地址
"rent" => 5000,//租金每月
"operator_id" => 5775,
);
$checkResult = $this->validate($params, "StoreFeeValidate.addFeeOffice");
$checkResult = $this->validate($params, "StoreFeeValidate.addOffice");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$data["site_id"] = $params['name'];
$data["office_name"] = $params['city'];
$data["office_address"] = $params['city'];
$data["rent"] = $params['city'];
$data["site_id"] = $params['site_id'];
$data["office_name"] = $params['office_name'];
$data["office_address"] = $params['office_address'];
$data["rent"] = $params['rent'];
$data["operator_id"] = $this->userId;
$res = $this->f_office->saveOffice($data);//int(1)
......
......@@ -23,7 +23,7 @@ class StoreFeeValidate extends Validate {
];
protected $scene = [
'addFeeOffice' => [ 'site_id', 'office_name', 'office_address', 'rent' ],
'addOffice' => [ 'site_id', 'office_name', 'office_address', 'rent' ],
];
}
\ No newline at end of file
......@@ -509,7 +509,7 @@ Route::group('index', [
'yindaoAndroidOffice' => ['index/ShareOfficeRoom/yindaoAndroid', ['method' => 'POST|GET']],
'yindaoIosOffice' => ['index/ShareOfficeRoom/yindaoIos', ['method' => 'POST|GET']],
'addFeeOffice' => ['index/StoreFee/addFeeOffice', ['method' => 'POST|GET']],
'addOffice' => ['index/StoreFee/addOffice', ['method' => 'POST|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