Cart.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. /*
  8. * @Author: your name
  9. * @Date: 2021-03-02 09:50:20
  10. * @LastEditTime: 2021-05-15 11:49:19
  11. * @LastEditors: Please set LastEditors
  12. * @Description: In User Settings Edit
  13. * @FilePath: \admin_php\models\Cart.php
  14. */
  15. namespace app\models;
  16. use Yii;
  17. /**
  18. * This is the model class for table "{{%cart}}".
  19. *
  20. * @property int $id
  21. * @property int $store_id
  22. * @property int $user_id 用户id
  23. * @property int $goods_id 商品id
  24. * @property int $num 商品数量
  25. * @property int $created_at
  26. * @property int $is_delete
  27. * @property string $attr 规格
  28. * @property int $mch_id 入驻商id
  29. * @property int $md_id 门店id
  30. */
  31. class Cart extends \yii\db\ActiveRecord
  32. {
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public static function tableName()
  37. {
  38. return '{{%cart}}';
  39. }
  40. /**
  41. * {@inheritdoc}
  42. */
  43. public function rules()
  44. {
  45. return [
  46. [['store_id', 'user_id', 'goods_id', 'attr'], 'required'],
  47. [['store_id', 'user_id', 'goods_id', 'num', 'created_at', 'is_delete', 'mch_id', 'md_id'], 'integer'],
  48. [['attr'], 'string'],
  49. ];
  50. }
  51. /**
  52. * {@inheritdoc}
  53. */
  54. public function attributeLabels()
  55. {
  56. return [
  57. 'id' => 'ID',
  58. 'store_id' => 'Store ID',
  59. 'user_id' => '用户id',
  60. 'goods_id' => '商品id',
  61. 'num' => '商品数量',
  62. 'created_at' => 'created_at',
  63. 'is_delete' => 'Is Delete',
  64. 'attr' => '规格',
  65. 'mch_id' => '入驻商id',
  66. ];
  67. }
  68. }