|
|
@@ -38,7 +38,8 @@ class AssetLeaseLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
public function setSearch(): array
|
|
|
{
|
|
|
return [
|
|
|
- '=' => ['name', 'status']
|
|
|
+ '=' => [ 'approval_status'],
|
|
|
+ '%like%'=>['tenant_name','tenant_mobile'],
|
|
|
];
|
|
|
}
|
|
|
|
|
|
@@ -53,30 +54,31 @@ class AssetLeaseLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
*/
|
|
|
public function lists(): array
|
|
|
{
|
|
|
-
|
|
|
+ var_dump($this->adminInfo);die;
|
|
|
$parms = $this->request->get();
|
|
|
$where = [] ;
|
|
|
if(!empty($parms))
|
|
|
{
|
|
|
- if(isset($parms['asset_name'])){
|
|
|
- $awhere = [] ;
|
|
|
- $awhere[] = ['name', 'like', '%' . $parms['asset_name']. '%'];
|
|
|
- $assetList = AssetInfo::where($awhere)->select()->toArray();
|
|
|
- $a_id_Arr = array_column($assetList,'id');
|
|
|
- $where[]=['a_id','in',$a_id_Arr];
|
|
|
- }
|
|
|
-
|
|
|
- if(isset($parms['tenant_name'])){
|
|
|
- if(!empty($parms['tenant_name'])){
|
|
|
- $where[] = ['tenant_name', 'like', '%' . $parms['tenant_name']. '%'];
|
|
|
+ if(isset($parms['asset_name'])) {
|
|
|
+ if (!empty($parms['asset_name'])) {
|
|
|
+ $awhere = [];
|
|
|
+ $awhere[] = ['name', 'like', '%' . $parms['asset_name'] . '%'];
|
|
|
+ $assetList = AssetInfo::where($awhere)->select()->toArray();
|
|
|
+ $a_id_Arr = array_column($assetList, 'id');
|
|
|
+ $where[] = ['a_id', 'in', $a_id_Arr];
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if(isset($parms['tenant_mobile'])){
|
|
|
- if(!empty($parms['tenant_mobile'])){
|
|
|
- $where[] = ['tenant_mobile', 'like', '%' . $parms['tenant_mobile']. '%'];
|
|
|
+ if(isset($parms['date_type'])) {
|
|
|
+ if (!empty($parms['start_time']) && !empty($parms['end_time'])) {
|
|
|
+ if($parms['date_type'] == 1){
|
|
|
+ $where[] = ['create_time', 'between', [strtotime($parms['start_time']),strtotime($parms['end_time']. ' 23:59:59')]];
|
|
|
+ }else if($parms['date_type'] == 2){
|
|
|
+ $where[] = ['lease_start_time', '>=', $parms['start_time']];
|
|
|
+ $where[] = ['lease_end_time', '<=', $parms['end_time']];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
$lists = (new AssetLeaseInfo())->field('*')
|
|
|
@@ -84,7 +86,7 @@ class AssetLeaseLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
->with('asset')
|
|
|
->with('referee')
|
|
|
->where($where)
|
|
|
-// ->where($this->searchWhere)
|
|
|
+ ->where($this->searchWhere)
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
->Order('id desc')
|
|
|
->select()
|