2 回答

TA贡献1786条经验 获得超11个赞
class Client extends Model
{
protected $table = 'client';
protected $primaryKey = 'Cid';
protected $guarded = ['Qid'];
protected $fillable = ['name', 'address', 'contact', 'created_at', 'updated_at' ];
public function client()
{
return $this->hasMany('App\qt',Qid,Cid);
}
}
class qt extends Model
{
protected $table = 'qts';
protected $primaryKey = 'Qid';
protected $guarded = ['Cid'];
protected $fillable=['Itemname','Quantity','Price','Tax','Total','GrandTotal','created_at', 'updated_at'];
public function qts()
{
return $this->belongsTo('App\Client',Cid,Qid);
}
}
- 2 回答
- 0 关注
- 199 浏览
添加回答
举报