You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 lines
1.4 KiB

  1. <?php
  2. namespace backend\modules\api\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "error_order_log".
  6. *
  7. * @property integer $id
  8. * @property string $error_info
  9. * @property integer $order_id
  10. * @property string $create_time
  11. */
  12. class ErrorOrderLog extends \yii\db\ActiveRecord
  13. {
  14. /**
  15. * @inheritdoc
  16. */
  17. public static function tableName()
  18. {
  19. return 'error_order_log';
  20. }
  21. /**
  22. * @inheritdoc
  23. */
  24. public function rules()
  25. {
  26. return [
  27. [['order_id'], 'integer'],
  28. [['error_info'], 'string', 'max' => 255],
  29. [['create_time'], 'string', 'max' => 50],
  30. ];
  31. }
  32. /**
  33. * @inheritdoc
  34. */
  35. public function attributeLabels()
  36. {
  37. return [
  38. 'id' => 'ID',
  39. 'error_info' => '简单错误记录',
  40. 'order_id' => '出错订单号',
  41. 'create_time' => 'Create Time',
  42. ];
  43. }
  44. /**
  45. * Function Description:订单弱错误记录
  46. * Function Name: istOrderLog
  47. * @param $order_id
  48. * @param $error_info
  49. *
  50. *
  51. * @author 娄梦宁
  52. */
  53. public function istOrderLog($order_id,$error_info){
  54. $value=[
  55. 'order_id'=>$order_id,
  56. 'error_info'=>$error_info,
  57. 'create_time'=>date('Y-m-d H:i:s'),
  58. ];
  59. $clone=clone $this;
  60. $clone->attributes=$value;
  61. $clone->insert();
  62. }
  63. }