<?php namespace app\api\model; use think\Model; class BuycarModel extends Model { protected $name = 'buycar'; public function commodity() { return $this->hasOne('commodityModel','c_id','c_id'); } }