|
- <?php
-
- namespace backend\modules\api\models;
-
- use Yii;
-
- /**
- * This is the model class for table "error_order_log".
- *
- * @property integer $id
- * @property string $error_info
- * @property integer $order_id
- * @property string $create_time
- */
- class ErrorOrderLog extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'error_order_log';
- }
-
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['order_id'], 'integer'],
- [['error_info'], 'string', 'max' => 255],
- [['create_time'], 'string', 'max' => 50],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'error_info' => '简单错误记录',
- 'order_id' => '出错订单号',
- 'create_time' => 'Create Time',
- ];
- }
-
- /**
- * Function Description:订单弱错误记录
- * Function Name: istOrderLog
- * @param $order_id
- * @param $error_info
- *
- *
- * @author 娄梦宁
- */
- public function istOrderLog($order_id,$error_info){
- $value=[
- 'order_id'=>$order_id,
- 'error_info'=>$error_info,
- 'create_time'=>date('Y-m-d H:i:s'),
- ];
- $clone=clone $this;
- $clone->attributes=$value;
- $clone->insert();
- }
- }
|