getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } public function getTypeList() { return ['1' => __('Type 1'), '2' => __('Type 2')]; } public function getStatusList() { return ['0' => __('Status 0'), '1' => __('Status 1')]; } public function getCoinTypeList() { return ['1' => __('Coin_type 1'), '2' => __('Coin_type 2')]; } public function getMfStatusList() { return ['0' => __('Mf_status 0'), '1' => __('Mf_status 1')]; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); $valueArr = explode(',', $value); $list = $this->getTypeList(); return implode(',', array_intersect_key($list, array_flip($valueArr))); } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getCoinTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['coin_type']) ? $data['coin_type'] : ''); $list = $this->getCoinTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getMfStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['mf_status']) ? $data['mf_status'] : ''); $list = $this->getMfStatusList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setTypeAttr($value) { return is_array($value) ? implode(',', $value) : $value; } }