35 lines
897 B
PHP
35 lines
897 B
PHP
<?php
|
|
|
|
namespace common\models\oldDb;
|
|
|
|
use yii\behaviors\TimestampBehavior;
|
|
use yii\db\ActiveRecord;
|
|
|
|
class PrescripOrderLog extends \common\modelsgii\oldDb\PrescripOrderLog
|
|
{
|
|
public function behaviors()
|
|
{
|
|
return [
|
|
[
|
|
'class' => 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();
|
|
}
|
|
} |