getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } public function getTypeTotalList() { return ['sum' => __('Sum'), 'count' => __('Count')]; } 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 getTypeTimeList() { return ['today' => __('Today'), 'week' => __('Week'), 'month' => __('Month')]; } public function getTypeTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['type_time']) ? $data['type_time'] : ''); $list = $this->getTypeTimeList(); return isset($list[$value]) ? $list[$value] : ''; } }