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.
 
 
 
 
 
 

91 rivejä
2.1 KiB

  1. <?php
  2. /**
  3. * 数据库表类 log_order
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 倪宗锋
  12. * PhpStorm LoginController.php
  13. * Create By 2017/11/21 17:44 $
  14. */
  15. namespace common\models;
  16. use common\util\Util;
  17. use yii\db\ActiveRecord;
  18. use yii\db\Exception;
  19. /**
  20. * 数据库表类 log_order.
  21. * @property integer $id
  22. * @property string $name
  23. * @property integer $order_id
  24. * @property string $time
  25. * @property integer $uid
  26. * @property integer $u_type
  27. * @property integer $log_type
  28. */
  29. class LogOrder extends ActiveRecord
  30. {
  31. /**
  32. * @inheritdoc
  33. */
  34. public static function tableName()
  35. {
  36. return 'log_order';
  37. }
  38. /**
  39. * @inheritdoc
  40. */
  41. public function rules()
  42. {
  43. return [
  44. [['order_id', 'uid', 'u_type', 'log_type'], 'integer'],
  45. [['time'], 'safe'],
  46. [['name'], 'string', 'max' => 20],
  47. ];
  48. }
  49. /**
  50. * @inheritdoc
  51. */
  52. public function attributeLabels()
  53. {
  54. return [
  55. 'id' => 'ID',
  56. 'name' => 'Name',
  57. 'order_id' => 'Order ID',
  58. 'time' => 'Time',
  59. 'uid' => 'Uid',
  60. 'u_type' => 'U Type',
  61. 'log_type' => 'Log Type',
  62. ];
  63. }
  64. /**
  65. * Des:添加记录
  66. * Name: addInfo
  67. * @param $data
  68. * @return bool
  69. * @author 倪宗锋
  70. */
  71. public function addInfo($data)
  72. {
  73. try {
  74. $this->setAttributes($data);
  75. $res = $this->save(false);
  76. if ($res == false) {
  77. return false;
  78. }
  79. return true;
  80. } catch (Exception $e) {
  81. return false;
  82. }
  83. }
  84. }