getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } public function getTypeList() { $result = ['1' =>'轮播','2' =>'横4','3' =>'竖4','4' => '标题导航','5'=>'搜索','6'=>'块导航','7'=>'榜单','8'=>'最近阅读块', '11' => '横3', '12' => '竖4(大)']; return $result; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : $data['type']; $list = $this->getTypeList(); return isset($list[$value]) ? $list[$value] : ''; } }