hasOne(PluginWumaSourceProduce::class, 'batch', 'pbatch'); return $one->with(['bindGoods', 'bindTemplate']); } /** * 关联生产批次数据 * @return \think\model\relation\HasOne */ public function bindProduce(): HasOne { return $this->produce()->bind([ 'tcode' => 'tcode', 'tname' => 'tname', 'ghash' => 'ghash', 'gcode' => 'gcode', 'gname' => 'gname', 'gspec' => 'gspec', 'gunit' => 'gunit', 'gcover' => 'gcover', ]); } /** * 关联生产模板数据 * @return HasOne */ public function assign(): HasOne { return $this->hasOne(PluginWumaSourceAssign::class, 'batch', 'batch'); } }