PropertyHeadLists.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\lists\property;
  15. use app\adminapi\lists\BaseAdminDataLists;
  16. use app\common\model\property\PropertyHead;
  17. use app\common\lists\ListsSearchInterface;
  18. /**
  19. * PropertyHead列表
  20. * Class PropertyHeadLists
  21. * @package app\adminapi\lists
  22. */
  23. class PropertyHeadLists extends BaseAdminDataLists implements ListsSearchInterface
  24. {
  25. /**
  26. * @notes 设置搜索条件
  27. * @return \string[][]
  28. * @author likeadmin
  29. * @date 2024/09/19 10:48
  30. */
  31. public function setSearch(): array
  32. {
  33. return [
  34. '=' => ['is_cooperate','sale_type','sale_id','property_name', 'village_name', 'address', 'head_name', 'head_mobile', 'ratio', 'head_bank_card', 'remark', 'user_id', 'all_profit_amount', 'surplus_profit_amount', 'extract_profit_amount'],
  35. ];
  36. }
  37. /**
  38. * @notes 获取列表
  39. * @return array
  40. * @throws \think\db\exception\DataNotFoundException
  41. * @throws \think\db\exception\DbException
  42. * @throws \think\db\exception\ModelNotFoundException
  43. * @author likeadmin
  44. * @date 2024/09/19 10:48
  45. */
  46. public function lists(): array
  47. {
  48. return PropertyHead::where($this->searchWhere)
  49. ->field(['id', 'property_name', 'village_name', 'address', 'head_name', 'head_mobile', 'ratio', 'head_bank_card', 'remark', 'user_id', 'all_profit_amount', 'surplus_profit_amount', 'extract_profit_amount','lon', 'lat','bind_date','sale_type','sale_id','is_cooperate'])
  50. ->limit($this->limitOffset, $this->limitLength)
  51. ->order(['id' => 'desc'])
  52. ->select()
  53. ->toArray();
  54. }
  55. /**
  56. * @notes 获取数量
  57. * @return int
  58. * @author likeadmin
  59. * @date 2024/09/19 10:48
  60. */
  61. public function count(): int
  62. {
  63. return PropertyHead::where($this->searchWhere)->count();
  64. }
  65. }