getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); } }); } /** * 关联栏目数据 * @return \think\model\relation\HasOne */ public function OfficialCategory() { return $this->hasOne('official_category', 'id', 'official_category_id'); } }