getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } public static function getTypeList() { return [ 'url' => __('Request Url'), 'sql' => __('Execute Sql Script'), 'shell' => __('Execute Shell'), ]; } public function getTypeTextAttr($value, $data) { $typelist = self::getTypeList(); $value = $value ? $value : $data['type']; return $value && isset($typelist[$value]) ? $typelist[$value] : $value; } protected function setBegintimeAttr($value) { return $value && !is_numeric($value) ? strtotime($value) : $value; } protected function setEndtimeAttr($value) { return $value && !is_numeric($value) ? strtotime($value) : $value; } protected function setExecutetimeAttr($value) { return $value && !is_numeric($value) ? strtotime($value) : $value; } }