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

36 lines
887 B
PHP

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