Procházet zdrojové kódy

查询服务商信息

moonsflyer před 8 měsíci
rodič
revize
d11711e0d4

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

@@ -121,7 +121,7 @@ class ServiceLogic extends BaseLogic
             $where[]=['user_id','=',$user_id];
             $where[]=['type','=',$params['type']];
 
-            $serviceInfo = UserService::where($where)->findOrEmpty();
+            $serviceInfo = UserService::where($where) ->append(['type_desc','cate_desc','area_desc','images','pay_info'])->findOrEmpty();
 
             if($serviceInfo->isEmpty()){
                 $status = -1;

+ 6 - 5
app/common/model/agricultural_machinery/UserService.php

@@ -17,6 +17,7 @@ namespace app\common\model\agricultural_machinery;
 use app\common\model\agricultural_machinery\ServiceCategory;
 use app\common\model\BaseModel;
 use app\common\model\asset\AssetArea;
+use app\common\model\recharge\RechargeOrder;
 use app\common\service\FileService;
 use think\model\concern\SoftDelete;
 
@@ -43,7 +44,6 @@ class UserService extends BaseModel
         return $this->hasMany(Article::class, 'cid', 'id');
     }
 
-
     /**
      * @notes 状态描述
      * @param $value
@@ -59,17 +59,18 @@ class UserService extends BaseModel
 
 
     /**
-     * @notes 文章数量
+     * @notes
      * @param $value
      * @param $data
      * @return int
      * @author 段誉
      * @date 2022/9/15 11:32
      */
-    public function getAriculturalMachineryCountAttr($value, $data)
+    public function getPayInfoAttr($value, $data)
     {
-        return 10;
-//        return Article::where(['cid' => $data['id']])->count('id');
+        $where['user_id'] = $data['user_id'];
+        $rechare_order = RechargeOrder::where($where)->order('id desc')->find();
+        return $rechare_order;
     }
 
     public function getTypeDescAttr($value,$data){