Просмотр исходного кода

物业订单新增月总金额,单量
后台质保金缴纳方式不允许再次修改
后台工程师审核通过时候报错
超出服务区域问题

liugc 1 год назад
Родитель
Сommit
81faa00a2e

+ 1 - 1
app/adminapi/lists/master_worker_register/MasterWorkerRegisterLists.php

@@ -58,7 +58,7 @@ class MasterWorkerRegisterLists extends BaseAdminDataLists implements ListsSearc
     public function lists(): array
     {
         return MasterWorkerRegister::where($this->searchWhere)
-            ->field(['id', 'maintain_exp_type', 'other_exp_type', 'city', 'vehicle_type', 'name', 'age', 'mobile', 'status','is_credential','credential_name'])
+            ->field(['id', 'maintain_exp_type', 'other_exp_type', 'city', 'vehicle_type', 'name', 'age', 'mobile', 'status','is_credential','credential_name','lat','lon'])
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])
             ->select()

+ 5 - 0
app/adminapi/logic/master_worker/MasterWorkerLogic.php

@@ -17,6 +17,7 @@ namespace app\adminapi\logic\master_worker;
 
 use app\common\model\master_worker\MasterWorker;
 use app\common\logic\BaseLogic;
+use app\common\model\master_worker\MasterWorkerRetentionMoneyLog;
 use think\db\Query;
 use think\facade\Config;
 use think\facade\Db;
@@ -165,6 +166,10 @@ class MasterWorkerLogic extends BaseLogic
             $info['category_ids'] = explode(',',$info['category_ids']);
             $info['category_ids'] = array_map('intval', $info['category_ids']);
         }
+        $info['is_up_retention_pay'] = 0;
+        if(MasterWorkerRetentionMoneyLog::where(['worker_id' => $params['id'],'action' => 1])->count('id') > 0){
+            $info['is_up_retention_pay'] = 1;
+        }
         return $info;
     }
 

+ 3 - 1
app/adminapi/logic/master_worker_register/MasterWorkerRegisterLogic.php

@@ -129,6 +129,8 @@ class MasterWorkerRegisterLogic extends BaseLogic
                 'mobile' => $params['mobile'],
                 'password' => $password,
                 'channel' => 1,
+                'lon' => $params['lon']??0,
+                'lat' => $params['lat']??0,
             ]);
         }
         return $masterWorker->id;
@@ -162,7 +164,7 @@ class MasterWorkerRegisterLogic extends BaseLogic
     {
         $registerInfo = MasterWorkerRegister::findOrEmpty($params['id'])->toArray();
         if ($registerInfo && $registerInfo['worker_id']) {
-            $account = MasterWorker::where('worker_id',$registerInfo['worker_id'])->value('account');
+            $account = MasterWorker::where('id',$registerInfo['worker_id'])->value('account');
             $openid = MasterWorkerAuth::where('worker_id',$registerInfo['worker_id'])->value('openid');
             event('Notice',  [
                 'scene_id' => NoticeEnum::ACCOUNT_PASSWORD,

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

@@ -2,6 +2,7 @@
 namespace app\api\lists\property;
 
 use app\api\lists\BaseApiDataLists;
+use app\common\lists\ListsExtendInterface;
 use app\common\lists\ListsSearchInterface;
 use app\common\model\property\PropertyCommission;
 use app\common\model\property\PropertyHead;
@@ -11,7 +12,7 @@ use app\common\model\recharge\RechargeOrder;
 /**
  * 订单列表
  */
-class PropertyCommissionLists extends BaseApiDataLists implements ListsSearchInterface
+class PropertyCommissionLists extends BaseApiDataLists implements ListsSearchInterface,ListsExtendInterface
 {
 
     public function setSearch(): array
@@ -67,4 +68,12 @@ class PropertyCommissionLists extends BaseApiDataLists implements ListsSearchInt
     {
         return PropertyCommission::where($this->searchWhere)->where($this->queryWhere())->count();
     }
+    /**
+     * @notes  返回扩展数据
+     * @return array|int
+     */
+    public function extend(): array
+    {
+        return [];
+    }
 }

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

@@ -2,16 +2,19 @@
 namespace app\api\lists\property;
 
 use app\api\lists\BaseApiDataLists;
+use app\common\lists\ListsExtendInterface;
 use app\common\lists\ListsSearchInterface;
 use app\common\model\property\PropertyCommission;
 use app\common\model\property\PropertyHead;
 use app\common\model\property\PropertyOrder;
 use app\common\model\property\PropertySurplusLog;
+use app\common\model\works\ServiceWork;
+use DateTime;
 
 /**
  * 订单列表
  */
-class PropertyOrderLists extends BaseApiDataLists implements ListsSearchInterface
+class PropertyOrderLists extends BaseApiDataLists implements ListsSearchInterface,ListsExtendInterface
 {
 
     public function setSearch(): array
@@ -53,4 +56,27 @@ class PropertyOrderLists extends BaseApiDataLists implements ListsSearchInterfac
     {
         return PropertyOrder::where($this->searchWhere)->where($this->queryWhere())->count();
     }
+    /**
+     * @notes  返回扩展数据
+     * @return array|int
+     */
+    public function extend(): array
+    {
+        $workIds = PropertyOrder::where('order_status',3)->where($this->queryWhere())->column('work_id');
+        if(empty($workIds)){
+            return ['month_amount' => 0,'month_num' => 0];
+        }
+        $startDateTime = strtotime(date('Y-m-01'));
+        if(isset($this->params['start_month']) && $this->params['start_month']){
+            $startDateTime = strtotime($this->params['start_month']);
+        }
+        $endDateTime = strtotime('+1 month', strtotime($startDateTime))-1;
+        $serviceWork = ServiceWork::where([['id','in',$workIds],['work_pay_status','=',2],['approval','=',1]])
+            ->where('user_id',$this->userId)
+            ->where('create_time','BETWEEN',[$startDateTime,$endDateTime]);
+        return [
+            'month_amount' =>$serviceWork->sum('work_amount'),
+            'month_num' => $serviceWork->count('id')
+        ];
+    }
 }

+ 1 - 1
app/api/logic/PropertyOrderLogic.php

@@ -46,7 +46,7 @@ class PropertyOrderLogic extends BaseLogic
             PropertyOrder::create([
                 'property_head_id' => $params['property_head_id'],
                 'property_user_id' => $propertyUserId,
-                'remark' => $params['remark']
+                'remark' => $params['remark']??'',
             ]);
             Db::commit();
             return true;

+ 1 - 1
app/api/logic/ServiceOrderLogic.php

@@ -65,7 +65,7 @@ class ServiceOrderLogic extends BaseLogic
         try {
             // 订单位置是否在服务区内
             if(!self::isService($params)){
-                //throw new Exception('已超出服务区域!');
+                throw new Exception('已超出服务区域!');
             }
             $goods = Goods::findOrEmpty($params['goods_id']);
             if($goods->isEmpty()){

+ 3 - 0
app/common/logic/BaseLogic.php

@@ -16,6 +16,8 @@
 namespace app\common\logic;
 
 
+use think\facade\Log;
+
 /**
  * 逻辑基类
  * Class BaseLogic
@@ -61,6 +63,7 @@ class BaseLogic
      */
     public static function setError($error) : void
     {
+        Log::debug('BaseLogic:setError:'.$error);
         !empty($error) && self::$error = $error;
     }