getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } public function getTypeTotalList() { return ['sum' => __('Sum'), 'count' => __('Count')]; } public function getChartTypeList() { return ['pie' => __('Pie'), 'graph' => __('Graph'), 'histogram' => __('Histogram')]; } public function getTypeTotalTextAttr($value, $data) { $value = $value ? $value : (isset($data['type_total']) ? $data['type_total'] : ''); $list = $this->getTypeTotalList(); return isset($list[$value]) ? $list[$value] : ''; } public function getChartTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['chart_type']) ? $data['chart_type'] : ''); $list = $this->getChartTypeList(); return isset($list[$value]) ? $list[$value] : ''; } }