HouseApi.php 885 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\common\api;
  3. use app\common\state\MainState;
  4. use think\facade\Db;
  5. use app\common\model\HousePurchase as houseModel;
  6. use app\common\model\HousePurchaseChildren as houseChildModel;
  7. use app\common\model\HousePurchaseHouseInfo as houseInfoModel;
  8. /**
  9. * Description of HouseApi
  10. *
  11. * @author sgq
  12. */
  13. class HouseApi {
  14. public static function getInfoById($id) {
  15. return houseModel::findOrEmpty($id)->toArray();
  16. }
  17. public static function getHouseInfo($idCard) {
  18. if (\StrUtil::isEmpOrNull($idCard)) {
  19. return null;
  20. }
  21. $where = [];
  22. $where[] = ["idCard", "=", $idCard];
  23. return houseInfoModel::where($where)->find();
  24. }
  25. public static function getChildren($id) {
  26. $where = [];
  27. $where[] = ["pId", "=", $id];
  28. return houseChildModel::where($where)->select()->toArray();
  29. }
  30. }