Kaynağa Gözat

Merge branch 'wuye-d'

liugc 1 yıl önce
ebeveyn
işleme
624eb7c6c4

+ 4 - 0
app/adminapi/logic/property/PropertyHeadLogic.php

@@ -48,6 +48,8 @@ class PropertyHeadLogic extends BaseLogic
                 'head_mobile' => $params['head_mobile'],
                 'ratio' => $params['ratio'],
                 'head_bank_card' => $params['head_bank_card'],
+                'lon' => $params['lon'],
+                'lat' => $params['lat'],
                 'remark' => $params['remark']
             ]);
 
@@ -80,6 +82,8 @@ class PropertyHeadLogic extends BaseLogic
                 'head_mobile' => $params['head_mobile'],
                 'ratio' => $params['ratio'],
                 'head_bank_card' => $params['head_bank_card'],
+                'lon' => $params['lon'],
+                'lat' => $params['lat'],
                 'remark' => $params['remark']
             ]);
 

+ 8 - 1
app/adminapi/logic/property/PropertyOrderLogic.php

@@ -140,6 +140,9 @@ class PropertyOrderLogic extends BaseLogic
             self::setError('当前订单状态不允许操作');
             return false;
         }
+        $propertyHeadInfo =  PropertyHeadLogic::detail(['id'=>$orderInfo['property_head_id']]);
+        //$propertyHeadInfo['lon']  $propertyHeadInfo['lat']
+
         Db::startTrans();
         try {
 
@@ -153,10 +156,14 @@ class PropertyOrderLogic extends BaseLogic
                 'goods_id.require' => '订单商品不存在',
                 'contact_number.require' => '联系电话不存在',
                 'contact_people.require' => '联系人不存在',*/
+                // 物业地址拼接户主详细门牌号
+                $params['address'] = $params['address']?:($propertyHeadInfo['address'].$propertyUserInfo['address']);
                 $serviceOrderParams = array_merge($params,[
                     'user_id' => $propertyUserInfo['user_id'],
                     'terminal' => 4,
-                    'user_info' => ['mobile'=>$userInfo['mobile']]
+                    'user_info' => ['mobile'=>$userInfo['mobile']],
+                    'lon' => $propertyHeadInfo['lon']?:0,
+                    'lat' => $propertyHeadInfo['lat']?:0,
                 ]);
                 Log::write(json_encode($serviceOrderParams,JSON_UNESCAPED_UNICODE));
                 $result = ServiceOrderLogic::submitOrder($serviceOrderParams);

+ 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;
     }
 }

+ 2 - 2
app/common/model/property/PropertyOrder.php

@@ -32,12 +32,12 @@ class PropertyOrder extends BaseModel
     public function propertyHead()
     {
         return $this->hasOne(PropertyHead::class, 'id', 'property_head_id')
-            ->field('id,property_name,village_name,head_name');
+            ->field('*');
     }
     public function propertyUser()
     {
         return $this->hasOne(PropertyUser::class, 'id', 'property_user_id')
-            ->field('id,householder_name,householder_mobile');
+            ->field('*');
     }
     public function propertyWork()
     {