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