Yin Bin 4 months ago
parent
commit
563a10d6a1

+ 1 - 1
app/Models/AgentInfo.php

@@ -20,7 +20,7 @@ class AgentInfo extends Model
      */
     public function member()
     {
-        return $this->belongsTo(MemberUser::class, 'user_id');
+        return $this->belongsTo(MemberUser::class, 'user_id', 'id');
     }
 
     /**

+ 1 - 1
app/Models/AgentInfoRecord.php

@@ -20,6 +20,6 @@ class AgentInfoRecord extends Model
      */
     public function agent()
     {
-        return $this->belongsTo(AgentInfo::class, 'agent_id');
+        return $this->belongsTo(AgentInfo::class, 'agent_id', 'id');
     }
 }

+ 1 - 1
app/Models/AgentProject.php

@@ -20,6 +20,6 @@ class AgentProject extends Model
      */
     public function cate()
     {
-        return $this->belongsTo(AgentProjectCate::class, 'cate_id');
+        return $this->belongsTo(AgentProjectCate::class, 'cate_id', 'id');
     }
 }

+ 1 - 1
app/Models/AgentProjectCate.php

@@ -20,7 +20,7 @@ class AgentProjectCate extends Model
      */
     public function parentCate()
     {
-        return $this->belongsTo(ProjectCate::class, 'cate_id');
+        return $this->belongsTo(ProjectCate::class, 'cate_id', 'id');
     }
 
     /**

+ 1 - 1
app/Models/AgentRealAuthRecord.php

@@ -20,6 +20,6 @@ class AgentRealAuthRecord extends Model
      */
     public function agent()
     {
-        return $this->belongsTo(AgentInfo::class, 'agent_id');
+        return $this->belongsTo(AgentInfo::class, 'agent_id', 'id');
     }
 }

+ 1 - 1
app/Models/CoachInfoRecord.php

@@ -47,6 +47,6 @@ class CoachInfoRecord extends Model
      */
     public function coach()
     {
-        return $this->belongsTo(CoachUser::class, 'coach_id');
+        return $this->belongsTo(CoachUser::class, 'coach_id', 'id');
     }
 }

+ 1 - 1
app/Models/CoachLocation.php

@@ -22,6 +22,6 @@ class CoachLocation extends Model
      */
     public function coach()
     {
-        return $this->belongsTo(CoachUser::class, 'coach_id');
+        return $this->belongsTo(CoachUser::class, 'coach_id', 'id');
     }
 }

+ 1 - 1
app/Models/CoachProject.php

@@ -22,6 +22,6 @@ class CoachProject extends Model
      */
     public function basicInfo()
     {
-        return $this->belongsTo(Project::class, 'project_id');
+        return $this->belongsTo(Project::class, 'project_id', 'id');
     }
 }

+ 1 - 1
app/Models/CoachQualRecord.php

@@ -29,6 +29,6 @@ class CoachQualRecord extends Model
      */
     public function coach()
     {
-        return $this->belongsTo(CoachUser::class, 'coach_id');
+        return $this->belongsTo(CoachUser::class, 'coach_id', 'id');
     }
 }

+ 2 - 2
app/Models/CoachUser.php

@@ -54,7 +54,7 @@ class CoachUser extends Model
      */
     public function member()
     {
-        return $this->belongsTo(MemberUser::class, 'user_id');
+        return $this->belongsTo(MemberUser::class, 'user_id', 'id');
     }
 
     /**
@@ -135,7 +135,7 @@ class CoachUser extends Model
      */
     public function shop()
     {
-        return $this->belongsTo(ShopInfo::class, 'shop_id', 'shop_id');
+        return $this->belongsTo(ShopInfo::class, 'shop_id', 'shop_id', 'id');
     }
 
     /**

+ 1 - 1
app/Models/MemberAddress.php

@@ -22,6 +22,6 @@ class MemberAddress extends Model
      */
     public function member()
     {
-        return $this->belongsTo(MemberUser::class, 'user_id');
+        return $this->belongsTo(MemberUser::class, 'user_id', 'id');
     }
 }

+ 1 - 1
app/Models/MemberSocialAccount.php

@@ -51,6 +51,6 @@ class MemberSocialAccount extends Model
      */
     public function member()
     {
-        return $this->belongsTo(MemberUser::class, 'user_id');
+        return $this->belongsTo(MemberUser::class, 'user_id', 'id');
     }
 }

+ 3 - 3
app/Models/MemberUser.php

@@ -96,7 +96,7 @@ class MemberUser extends Authenticatable
      */
     public function wallet()
     {
-        return $this->morphOne(Wallet::class, 'owner', 'owner_type', 'owner_id');
+        return $this->morphOne(Wallet::class, 'owner', 'owner_type', 'owner_id', 'id');
     }
 
     /**
@@ -123,7 +123,7 @@ class MemberUser extends Authenticatable
      */
     public function region()
     {
-        return $this->belongsTo(SysRegion::class, 'register_area');
+        return $this->belongsTo(SysRegion::class, 'register_area', 'id');
     }
 
     /**
@@ -141,6 +141,6 @@ class MemberUser extends Authenticatable
      */
     public function teams()
     {
-        return $this->morphMany(MarketDistTeam::class, 'object', 'object_type', 'object_id');
+        return $this->morphMany(MarketDistTeam::class, 'object', 'object_type', 'object_id', 'id');
     }
 }

+ 2 - 2
app/Models/Order.php

@@ -31,7 +31,7 @@ class Order extends Model
      */
     public function member()
     {
-        return $this->belongsTo(MemberUser::class, 'user_id');
+        return $this->belongsTo(MemberUser::class, 'user_id', 'id');
     }
 
     /**
@@ -40,7 +40,7 @@ class Order extends Model
      */
     public function coach()
     {
-        return $this->belongsTo(CoachUser::class, 'coach_id');
+        return $this->belongsTo(CoachUser::class, 'coach_id', 'id');
     }
 
     /**

+ 3 - 3
app/Models/OrderComment.php

@@ -29,7 +29,7 @@ class OrderComment extends Model
      */
     public function member()
     {
-        return $this->belongsTo(MemberUser::class, 'user_id');
+        return $this->belongsTo(MemberUser::class, 'user_id', 'id');
     }
 
     /**
@@ -38,7 +38,7 @@ class OrderComment extends Model
      */
     public function coach()
     {
-        return $this->belongsTo(CoachUser::class, 'coach_id');
+        return $this->belongsTo(CoachUser::class, 'coach_id', 'id');
     }
 
     /**
@@ -47,6 +47,6 @@ class OrderComment extends Model
      */
     public function basicOrder()
     {
-        return $this->belongsTo(Order::class, 'order_id');
+        return $this->belongsTo(Order::class, 'order_id', 'id');
     }
 }

+ 1 - 1
app/Models/OrderDistRecord.php

@@ -29,6 +29,6 @@ class OrderDistRecord extends Model
      */
     public function basicOrder()
     {
-        return $this->belongsTo(Order::class, 'order_id');
+        return $this->belongsTo(Order::class, 'order_id', 'id');
     }
 }

+ 1 - 1
app/Models/OrderExcRecord.php

@@ -29,6 +29,6 @@ class OrderExcRecord extends Model
      */
     public function basicOrder()
     {
-        return $this->belongsTo(Order::class, 'order_id');
+        return $this->belongsTo(Order::class, 'order_id', 'id');
     }
 }

+ 2 - 2
app/Models/OrderGrabRecord.php

@@ -32,7 +32,7 @@ class OrderGrabRecord extends Model
      */
     public function coach()
     {
-        return $this->belongsTo(CoachUser::class, 'coach_id');
+        return $this->belongsTo(CoachUser::class, 'coach_id', 'id');
     }
 
     /**
@@ -41,6 +41,6 @@ class OrderGrabRecord extends Model
      */
     public function basicOrder()
     {
-        return $this->belongsTo(Order::class, 'order_id');
+        return $this->belongsTo(Order::class, 'order_id', 'id');
     }
 }

+ 1 - 1
app/Models/OrderRecord.php

@@ -32,6 +32,6 @@ class OrderRecord extends Model
      */
     public function basicOrder()
     {
-        return $this->belongsTo(Order::class, 'order_id');
+        return $this->belongsTo(Order::class, 'order_id', 'id');
     }
 }

+ 1 - 1
app/Models/Project.php

@@ -22,7 +22,7 @@ class Project extends Model
      */
     public function cate()
     {
-        return $this->belongsTo(ProjectCate::class, 'cate_id');
+        return $this->belongsTo(ProjectCate::class, 'cate_id', 'id');
     }
 
     /**

+ 1 - 1
app/Models/ShopAuthRecord.php

@@ -21,7 +21,7 @@ class ShopAuthRecord extends Model
      */
     public function shop()
     {
-        return $this->belongsTo(ShopInfo::class, 'shop_id');
+        return $this->belongsTo(ShopInfo::class, 'shop_id', 'id');
     }
 
     /**

+ 2 - 2
app/Models/ShopCoachService.php

@@ -20,7 +20,7 @@ class ShopCoachService extends Model
      */
     public function shopService()
     {
-        return $this->belongsTo(ShopService::class, 'service_id');
+        return $this->belongsTo(ShopService::class, 'service_id', 'id');
     }
 
     /**
@@ -29,6 +29,6 @@ class ShopCoachService extends Model
      */
     public function coach()
     {
-        return $this->belongsTo(CoachUser::class, 'coach_id');
+        return $this->belongsTo(CoachUser::class, 'coach_id', 'id');
     }
 }

+ 1 - 1
app/Models/ShopInfo.php

@@ -20,7 +20,7 @@ class ShopInfo extends Model
      */
     public function member()
     {
-        return $this->belongsTo(MemberUser::class, 'user_id');
+        return $this->belongsTo(MemberUser::class, 'user_id', 'id');
     }
 
     /**

+ 2 - 2
app/Models/ShopService.php

@@ -20,7 +20,7 @@ class ShopService extends Model
      */
     public function shop()
     {
-        return $this->belongsTo(ShopInfo::class, 'shop_id');
+        return $this->belongsTo(ShopInfo::class, 'shop_id', 'id');
     }
 
     /**
@@ -29,7 +29,7 @@ class ShopService extends Model
      */
     public function project()
     {
-        return $this->belongsTo(Project::class, 'service_id');
+        return $this->belongsTo(Project::class, 'service_id', 'id');
     }
 
     /**

+ 1 - 1
app/Models/SysRegion.php

@@ -20,6 +20,6 @@ class SysRegion extends Model
      */
     public function parentRegion()
     {
-        return $this->belongsTo(SysRegion::class, 'parentId');
+        return $this->belongsTo(SysRegion::class, 'parentId', 'id');
     }
 }

+ 1 - 1
app/Models/Wallet.php

@@ -42,7 +42,7 @@ class Wallet extends Model
      */
     public function member()
     {
-        return $this->belongsTo(MemberUser::class, 'owner_id');
+        return $this->belongsTo(MemberUser::class, 'owner_id', 'id');
     }
 
     /**

+ 2 - 2
app/Models/WalletPaymentRecord.php

@@ -22,7 +22,7 @@ class WalletPaymentRecord extends Model
      */
     public function trans()
     {
-        return $this->belongsTo(WalletTransRecord::class, 'trans_record_id');
+        return $this->belongsTo(WalletTransRecord::class, 'trans_record_id', 'id');
     }
 
     /**
@@ -31,6 +31,6 @@ class WalletPaymentRecord extends Model
      */
     public function wallet()
     {
-        return $this->belongsTo(Wallet::class, 'wallet_id');
+        return $this->belongsTo(Wallet::class, 'wallet_id', 'id');
     }
 }

+ 2 - 2
app/Models/WalletRefundRecord.php

@@ -22,7 +22,7 @@ class WalletRefundRecord extends Model
      */
     public function wallet()
     {
-        return $this->belongsTo(Wallet::class, 'wallet_id');
+        return $this->belongsTo(Wallet::class, 'wallet_id', 'id');
     }
 
     /**
@@ -31,6 +31,6 @@ class WalletRefundRecord extends Model
      */
     public function trans()
     {
-        return $this->belongsTo(WalletTransRecord::class, 'trans_record_id');
+        return $this->belongsTo(WalletTransRecord::class, 'trans_record_id', 'id');
     }
 }

+ 1 - 1
app/Models/WalletTransRecord.php

@@ -22,7 +22,7 @@ class WalletTransRecord extends Model
      */
     public function wallet()
     {
-        return $this->belongsTo(Wallet::class, 'wallet_id');
+        return $this->belongsTo(Wallet::class, 'wallet_id', 'id');
     }
 
     /**

+ 2 - 2
app/Models/WalletWithdrawRecord.php

@@ -22,7 +22,7 @@ class WalletWithdrawRecord extends Model
      */
     public function trans()
     {
-        return $this->belongsTo(WalletTransRecord::class, 'trans_record_id');
+        return $this->belongsTo(WalletTransRecord::class, 'trans_record_id', 'id');
     }
 
     /**
@@ -31,6 +31,6 @@ class WalletWithdrawRecord extends Model
      */
     public function wallet()
     {
-        return $this->belongsTo(Wallet::class, 'wallet_id');
+        return $this->belongsTo(Wallet::class, 'wallet_id', 'id');
     }
 }