Files
xk-api-yii/common/models/oldDb/PrescriptionLog.php

36 lines
887 B
PHP

<?php
namespace common\models\oldDb;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
class PrescriptionLog extends \common\modelsgii\oldDb\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();
}
}