OrderItem.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. namespace App\Models;
  3. use DateTimeInterface;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * 外卖订单商品子表
  7. *
  8. * @property int $id 主键id
  9. * @property int $m_id 用户id
  10. * @property int|null $shop_id 商户id
  11. * @property int $order_id 订单id
  12. * @property int $goods_id 商品id
  13. * @property array $goods_spec_list 商品规格信息json
  14. * @property string $goods_name 商品名称
  15. * @property string $goods_img 商品封面图id
  16. * @property string $goods_attr 商品规格信息
  17. * @property string $goods_price 商品价格
  18. * @property int $goods_number 购买数量
  19. * @property string $goods_money 商品总价
  20. * @property string|null $shop_money 秒杀商品给商家结算价
  21. * @property \Illuminate\Support\Carbon|null $created_at
  22. * @property \Illuminate\Support\Carbon|null $updated_at
  23. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem newModelQuery()
  24. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem newQuery()
  25. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem query()
  26. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereCreatedAt($value)
  27. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereGoodsAttr($value)
  28. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereGoodsId($value)
  29. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereGoodsImg($value)
  30. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereGoodsMoney($value)
  31. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereGoodsName($value)
  32. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereGoodsNumber($value)
  33. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereGoodsPrice($value)
  34. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereGoodsSpecList($value)
  35. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereId($value)
  36. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereMId($value)
  37. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereOrderId($value)
  38. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereShopId($value)
  39. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereShopMoney($value)
  40. * @method static \Illuminate\Database\Eloquent\Builder|OrderItem whereUpdatedAt($value)
  41. * @mixin \Eloquent
  42. */
  43. class OrderItem extends Model
  44. {
  45. /**
  46. * The table associated with the model.
  47. *
  48. * @var string
  49. */
  50. protected $table = 'order_item';
  51. /**
  52. * The primary key associated with the table.
  53. *
  54. * @var string
  55. */
  56. protected $primaryKey = 'id';
  57. /**
  58. * Indicates if the model should be timestamped.
  59. *
  60. * @var bool
  61. */
  62. public $timestamps = true;
  63. /**
  64. * 类型转换
  65. *
  66. * @var array
  67. */
  68. protected $casts = [
  69. 'goods_spec_list' => 'array',
  70. ];
  71. /**
  72. * 不能被批量赋值的属性
  73. *
  74. * @var array
  75. */
  76. protected $guarded = ['id', 'updated_at', 'created_at'];
  77. }