Files
annnj-company 130c1026c4 first commit
2026-04-17 18:29:53 +08:00

128 lines
4.0 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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");
}
}