getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } /** * 关联分类 * @return \think\model\relation\BelongsTo */ public function category() { return $this->belongsTo('category'); } /** * 关联运费 * @return \think\model\relation\BelongsTo */ public function delivery() { return $this->belongsTo('delivery'); } }