@@ -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);
@@ -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;
+}
@@ -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');