12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace App\Models\Order;
- use App\Base\BaseModel;
- use App\Models\Goods\Goods;
- /**
- * App\Models\Order\OrderGoods
- *
- * @property int $id
- * @property int $order_id
- * @property int $goods_id
- * @property string $sn
- * @property int $count
- * @property \Illuminate\Support\Carbon|null $created_at
- * @property \Illuminate\Support\Carbon|null $updated_at
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods newModelQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods newQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods query()
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods whereCount($value)
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods whereCreatedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods whereGoodsId($value)
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods whereId($value)
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods whereOrderId($value)
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods whereSn($value)
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods whereUpdatedAt($value)
- * @mixin \Eloquent
- * @property int $sku_id
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods whereSkuId($value)
- * @property-read \App\Models\Order\Order|null $order
- * @property-read Goods|null $goods
- * @property array $custom
- * @method static \Illuminate\Database\Eloquent\Builder|OrderGoods whereCustom($value)
- */
- class OrderGoods extends BaseModel
- {
- protected $table = "order_goods";
- protected $casts = [
- "custom" => "array",
- ];
- public function order()
- {
- return $this->belongsTo(Order::class);
- }
- public function goods()
- {
- return $this->belongsTo(Goods::class, "goods_id");
- }
- }
|