2000], [['ID'], 'unique'], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'ID' => 'ID', 'PERIOD_NUM' => '周期数', 'TEXT' => '日志', 'CREATED_AT' => '创建时间', ]; } public static function record($periodNum, $text): bool { CalcRecord::insertOne([ 'PERIOD_NUM' => $periodNum, 'TEXT' => $text, 'CREATED_AT' => time(), ]); return true; } }