1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Models\Order;
- use App\Base\BaseModel;
- use App\Models\User\User;
- /**
- * App\Models\Order\Order
- *
- * @property int $id
- * @property int $user_id
- * @property \Illuminate\Support\Carbon|null $created_at
- * @property \Illuminate\Support\Carbon|null $updated_at
- * @method static \Illuminate\Database\Eloquent\Builder|Order newModelQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|Order newQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|Order query()
- * @method static \Illuminate\Database\Eloquent\Builder|Order whereCreatedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder|Order whereId($value)
- * @method static \Illuminate\Database\Eloquent\Builder|Order whereUpdatedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder|Order whereUserId($value)
- * @mixin \Eloquent
- * @property string $source 来源
- * @method static \Illuminate\Database\Eloquent\Builder|Order whereSource($value)
- * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Order\OrderGoods[] $goods
- * @property-read int|null $goods_count
- * @property-read User|null $user
- */
- class Order extends BaseModel
- {
- const SOURCE_GOODS = "goods";
- const SOURCE_CART = "cart";
- protected $table = "order";
- public function goods()
- {
- return $this->hasMany(OrderGoods::class);
- }
- public function user()
- {
- return $this->belongsTo(User::class);
- }
- }
|