소스 검색

add - 物业坐标 / 工单拼接地址

liugc 1 년 전
부모
커밋
ec7c78d2ac

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

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

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

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

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

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