Procházet zdrojové kódy

up - 新增物业资产提现状态 / 列表字段合并

liugc před 1 rokem
rodič
revize
24b7336dd8

+ 1 - 0
app/api/lists/property/PropertyCommissionLists.php

@@ -42,6 +42,7 @@ class PropertyCommissionLists extends BaseApiDataLists implements ListsSearchInt
                 ['payment_type', 'IN', [0,1]]
             ])->find())['orderGoods'][0];
         }
+        $lists = array_merge($lists,$lists['propertyHead'],$lists['propertyUser'],$lists['propertyWork']);
         return $lists;
     }
 

+ 1 - 0
app/api/lists/property/PropertyOrderLists.php

@@ -36,6 +36,7 @@ class PropertyOrderLists extends BaseApiDataLists implements ListsSearchInterfac
             ->order('create_time desc')
             ->select()
             ->toArray();
+        $lists = array_merge($lists,$lists['propertyHead'],$lists['propertyUser'],$lists['propertyWork']);
         return $lists;
     }
 

+ 1 - 0
app/api/lists/property/PropertySurplusLogLists.php

@@ -53,6 +53,7 @@ class PropertySurplusLogLists extends BaseApiDataLists implements ListsSearchInt
             }
             $item['surplus_sn'] = date('YmdHis',strtotime($item['create_time']));
         }
+        $lists = array_merge($lists,$lists['propertyHead']);
         return $lists;
     }
 

+ 12 - 1
app/api/logic/PropertyCommissionLogic.php

@@ -102,6 +102,11 @@ class PropertyCommissionLogic extends BaseLogic
     {
         Db::startTrans();
         try {
+            //提现状态0无申请中 1有申请中
+            $isId = PropertySurplusLog::where(['in_out' => 2,'status' => 0])->value('id');
+            if($isId){
+                throw new Exception('存在申请中订单,不可重复申请提现');
+            }
             $propertyHeadInfo = PropertyHead::where('user_id',$params['user_id'])->lock(true)->findOrEmpty();
             if($propertyHeadInfo->isEmpty()){
                 throw new Exception('物业负责人不存在');
@@ -144,6 +149,12 @@ class PropertyCommissionLogic extends BaseLogic
             self::setError('物业负责人不存在');
             return [];
         }
-        return $propertyHeadInfo->toArray();
+        $resData = $propertyHeadInfo->toArray();
+        $resData['surplus_status'] = 0;//提现状态0无申请中 1有申请中
+        $isId = PropertySurplusLog::where(['in_out' => 2,'status' => 0])->value('id');
+        if($isId){
+            $resData['surplus_status'] = 1;
+        }
+        return $resData;
     }
 }