Commit 92e65e81 authored by clone's avatar clone

委托转铺

parent c52fc7ab
...@@ -4,6 +4,7 @@ namespace app\api\controller; ...@@ -4,6 +4,7 @@ namespace app\api\controller;
use app\extra\RedisExt; use app\extra\RedisExt;
use think\cache\driver\Redis; use think\cache\driver\Redis;
use think\queue\Job;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
......
...@@ -23,25 +23,54 @@ class Sublet extends Basic ...@@ -23,25 +23,54 @@ class Sublet extends Basic
$this->subletMode = new SubletModel(); $this->subletMode = new SubletModel();
} }
/**
* 委托转铺列表
* @return \think\Response
*/
public function subletList()
{
$params = $this->params;
/* $params = array(
"user_id" => 1,
"page_no" => 1,
"page_size" => 15
);*/
$user_id = $params["user_id"];
if (!$user_id) {
return $this->response("101", "用户id不能为空");
}
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$select_["user_id"] = $user_id;
$fields = 'id,manage_type,address_detail,FORMAT(expected_rent/100,2) as expected_rent,create_time,status,house_id';
$result = $this->subletMode->getSublet($pageNo, $pageSize, "id desc", $fields, $select_);
if (count($result) > 0)
return $this->response("200", "success", $result);
return $this->response("101", "请求异常,请稍后再试");
}
public function addSublet() public function addSublet()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"user_id" => 47, "user_id" => 47,
"manage_type" => 美食, "manage_type" => 美食,
"address_detail" => "泗泾", "address_detail" => "泗泾",
"province" => "上海", "province" => "上海",
"city" => "长沙市", "city" => "长沙市",
"district" => "芙蓉区", "district" => "芙蓉区",
"expected_rent" => 2000, "expected_rent" => 2000,
"appellation" => "zhangsan", "appellation" => "zhangsan",
"tel" => 13817616162, "tel" => 13817616162,
"AuthToken" => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjo0NywidXNlck5pY2siOm51bGwsInBob25lIjoiMTgyMDU2MjUwMjAifSwidGltZVN0YW1wXyI6MTUxMzU3MzMwMH0.-_tpSDeucA6_V8glS1hfoNBpZU8lRk6J8On3-_Rdf_I', "AuthToken" => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjo0NywidXNlck5pY2siOm51bGwsInBob25lIjoiMTgyMDU2MjUwMjAifSwidGltZVN0YW1wXyI6MTUxMzU3MzMwMH0.-_tpSDeucA6_V8glS1hfoNBpZU8lRk6J8On3-_Rdf_I',
);*/ );*/
if (!isset($params["manage_type"])) { if (!isset($params["manage_type"])) {
return $this->response("101", "经营业态不能为空"); return $this->response("101", "经营业态不能为空");
} }
if (!isset($params["address_detail"])) { if (!isset($params["address_detail"])) {
...@@ -59,8 +88,8 @@ class Sublet extends Basic ...@@ -59,8 +88,8 @@ class Sublet extends Basic
if (!isset($params["expected_rent"])) { if (!isset($params["expected_rent"])) {
return $this->response("101", "期望租金不能为空"); return $this->response("101", "期望租金不能为空");
}else{ } else {
$params["expected_rent"] = $params["expected_rent"] * 100; $params["expected_rent"] = $params["expected_rent"] * 100;
} }
if (!isset($params["appellation"])) { if (!isset($params["appellation"])) {
......
...@@ -308,6 +308,7 @@ Route::group('api', [ ...@@ -308,6 +308,7 @@ Route::group('api', [
'addSublet' => [ 'api/Sublet/addSublet', [ 'method' => 'post|get' ] ], 'addSublet' => [ 'api/Sublet/addSublet', [ 'method' => 'post|get' ] ],
'subletList' => [ 'api/Sublet/subletList', [ 'method' => 'post|get' ] ],//委托转铺列表
//Version //Version
......
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