StudioOrder.php 702 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class StudioOrder extends Model{
  5. protected $table='studio_order';
  6. public function get_studio_detail(){
  7. return $this->hasMany(StudioOrderDetail::class,'order_id');
  8. }
  9. public function belong_user(){
  10. return $this->belongsTo(User::class,'good_user_id');
  11. }
  12. public function get_good(){
  13. return $this->belongsTo(StudioGood::class,'goods_id','id');
  14. }
  15. public function address(){
  16. return $this->belongsTo(Address::class,'address_id');
  17. }
  18. /**获取物流信息**/
  19. public function get_express(){
  20. return $this->hasMany(StudioExpress::class,'order_id');
  21. }
  22. }