Files
xk-api-yii/common/models/PrescriptionLog.php
2024-09-19 11:32:39 +08:00

36 lines
875 B
PHP

<?php
namespace common\models;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
class PrescriptionLog extends \common\modelsgii\PrescriptionLog
{
public function behaviors()
{
return [
[
'class' => 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)
{
$PrescriptionLog = new PrescriptionLog();
$PrescriptionLog->p_id = $p_id;
$PrescriptionLog->content = $message;
$PrescriptionLog->save();
}
}