SiteModel.php 377 B

123456789101112131415161718192021
  1. <?php
  2. namespace app\common\model;
  3. use think\Db;
  4. use think\db\Query;
  5. use think\Model;
  6. class SiteModel extends Model{
  7. protected $name='system_site';
  8. public $autoWriteTimestamp=true;
  9. public function towns(){
  10. return $this->hasOne(TownsModel::class,'id');
  11. }
  12. public function kd(){
  13. return $this->hasMany(ValuesModel::class,'site_id');
  14. }
  15. }