初始化仓库
This commit is contained in:
36
common/models/ProductOrderLog.php
Normal file
36
common/models/ProductOrderLog.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
class ProductOrderLog extends \common\modelsgii\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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user