songxingwei 2 anni fa
parent
commit
6498711cd7

+ 0 - 1
application/api/controller/Index.php

@@ -184,7 +184,6 @@ class Index extends Api
         $date = input('date');   //日期
         $list = SiteModel::where('is_del',1)
             ->with('towns,kd')
-
             ->field('id,code,name')
             ->select();
         dump($list);

+ 11 - 0
application/common/model/KdModel.php

@@ -0,0 +1,11 @@
+<?php
+namespace app\common\model;
+
+use think\Db;
+use think\db\Query;
+use think\Model;
+class KdModel extends Model{
+    protected $name='system_kd';
+    public $autoWriteTimestamp=true;
+
+}

+ 1 - 1
application/common/model/SiteModel.php

@@ -11,7 +11,7 @@ class SiteModel extends Model{
 
 
     public function kd(){
-        return $this->hasMany(ValuesModel::class,'name');
+        return KdModel::select();
     }
     public function towns(){
         return $this->hasOne(TownsModel::class,'id');