getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); } }); } public function getShowtypeList() { return ['image' => __('Showtype image')]; } public function getShowtypeTextAttr($value, $data) { $value = $value ?: ($data['showtype'] ?? ''); $list = $this->getShowtypeList(); return $list[$value] ?? ''; } public function cate() { return $this->belongsTo(MediaMatrixCate::class, 'cate_id', 'id', [], 'LEFT')->setEagerlyType(0); } }