first commit
This commit is contained in:
128
pgserver/application/lpdict/controller/LpDictBase.php
Normal file
128
pgserver/application/lpdict/controller/LpDictBase.php
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace app\LpDict\controller;
|
||||
use app\model\LpdictPropertySZ;
|
||||
use app\admin\controller\Base;
|
||||
use think\Db;
|
||||
|
||||
|
||||
class LpDictBase extends Base
|
||||
{
|
||||
|
||||
/**
|
||||
* @var LpdictPropertySZ
|
||||
*/
|
||||
protected $lpDictModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// 初始化模型实例
|
||||
$this->lpDictModel = new LpdictPropertySZ();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有物业名称列表。
|
||||
*
|
||||
* 该方法通过调用 LpdictPropertySZ 模型的 getEstateListByName 方法,
|
||||
* 获取物业名称列表,并将结果返回给客户端。
|
||||
*
|
||||
* @return \think\Response 返回 JSON 格式的物业名称列表
|
||||
*/
|
||||
public function getEstateListByName()
|
||||
{
|
||||
$name = $this->request->post('name','', 'trim');
|
||||
|
||||
// 调用模型中的 getEstateListByName 方法获取物业名称列表
|
||||
$propertyList = $this->lpDictModel->getEstateListByName($name, 10 );
|
||||
|
||||
// 将结果以 JSON 格式返回给客户端
|
||||
return $this->buildSuccess($propertyList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据首字母获取物业列表
|
||||
*
|
||||
* 该方法用于处理根据物业名称的首字母获取物业列表的请求,
|
||||
* 它接收一个名称参数,并返回与该首字母匹配的最多10个物业名称列表
|
||||
*
|
||||
* @return \think\Response 返回 JSON 格式的物业名称列表
|
||||
*/
|
||||
public function getEstateListByFirestLetter()
|
||||
{
|
||||
$name = $this->request->post('name', '', 'trim');
|
||||
|
||||
// 调用模型中的 getEstateListByName 方法获取物业名称列表
|
||||
$list = $this->lpDictModel->getEstateListByFristLetter($name, 10 );
|
||||
|
||||
// 将结果以 JSON 格式返回给客户端
|
||||
return $this->buildSuccess($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据首字母获取物业列表
|
||||
*
|
||||
* 该方法用于处理根据物业名称的首字母获取物业列表的请求,
|
||||
* 它接收一个名称参数,并返回与该首字母匹配的最多10个物业名称列表
|
||||
*
|
||||
* @return \think\Response 返回 JSON 格式的物业名称列表
|
||||
*/
|
||||
public function getPropertyListByBid()
|
||||
{
|
||||
$bid = $this->request->post('bid', '', 'trim');
|
||||
$hno = $this->request->post('hno', '', 'trim');
|
||||
|
||||
// 调用模型中的 getEstateListByName 方法获取物业名称列表
|
||||
$list = $this->lpDictModel->getPropertyListByBid($bid, $hno ,10 );
|
||||
|
||||
// 将结果以 JSON 格式返回给客户端
|
||||
return $this->buildSuccess($list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据首字母获取物业列表
|
||||
*
|
||||
* 该方法用于处理根据物业名称的首字母获取物业列表的请求,
|
||||
* 它接收一个名称参数,并返回与该首字母匹配的最多10个物业名称列表
|
||||
*
|
||||
* @return \think\Response 返回 JSON 格式的物业名称列表
|
||||
*/
|
||||
public function getBuildingListByLpid()
|
||||
{
|
||||
$lpid = $this->request->post('lpid', '', 'trim');
|
||||
|
||||
// 调用模型中的 getEstateListByName 方法获取物业名称列表
|
||||
$list = $this->lpDictModel->getBuildingListByLpid($lpid, 10 );
|
||||
|
||||
// 将结果以 JSON 格式返回给客户端
|
||||
return $this->buildSuccess($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据首字母获取物业列表
|
||||
*
|
||||
* 该方法用于处理根据物业名称的首字母获取物业列表的请求,
|
||||
* 它接收一个名称参数,并返回与该首字母匹配的最多10个物业名称列表
|
||||
*
|
||||
* @return \think\Response 返回 JSON 格式的物业名称列表
|
||||
*/
|
||||
public function getBuildingListByBName()
|
||||
{
|
||||
$BName = $this->request->post('bname', '', 'trim');
|
||||
$lpid = $this->request->post('lpid', '', 'trim');
|
||||
|
||||
// 调用模型中的 getEstateListByName 方法获取物业名称列表
|
||||
$list = $this->lpDictModel->getBuildingListByBName( $lpid, $BName, 10 );
|
||||
|
||||
// 将结果以 JSON 格式返回给客户端
|
||||
return $this->buildSuccess($list);
|
||||
}
|
||||
|
||||
|
||||
public function test()
|
||||
{
|
||||
return $this->buildSuccess("test success");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user