hasOne(PluginWumaSalesUser::class, 'id', 'auid'); } /** * 关联代理数据 * @return \think\model\relation\HasOne */ public function fromer(): HasOne { return $this->hasOne(PluginWumaSalesUser::class, 'id', 'xuid'); } /** * 关联商品数据 * @return \think\model\relation\HasOne */ public function goods(): HasOne { return $this->hasOne(PluginWemallGoodsItem::class, 'ghash', 'ghash')->with('bindGoods'); } /** * 绑定商品数据 * @return \think\model\relation\HasOne */ public function bindGoods(): HasOne { return $this->goods()->bind([ 'gunit' => 'gunit', 'gcode' => "gcode", 'gname' => 'gname', 'gspec' => 'gspec', 'gcover' => 'gcover', 'gstatus' => 'gstatus', 'gdeleted' => 'gdeleted', ]); } }