TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'], ], ], ]; } /** * 保存下单后的事件队列处理日志 * @param $po_id * @param $message */ public static function saveLog($po_id, $message) { $PrescripOrderLog = new PrescripOrderLog(); $PrescripOrderLog->$po_id = $po_id; $PrescripOrderLog->content = $message; $PrescripOrderLog->save(); } }