Fix profit_gold API for gold apps without orders relation eager load.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-09 17:25:20 +03:30
co-authored by Cursor
parent 9f4f0c0145
commit 280bf3bf38
2 changed files with 28 additions and 10 deletions
+6
View File
@@ -91,6 +91,12 @@ class Customer extends Authenticatable implements JWTSubject
{
return $this->hasMany(Wallet::class ,'owner')->with(['fund','product'])->select(['cash', 'fund_id','product_id','gold', 'owner']);
}
public function orders()
{
return $this->hasMany(Order::class, 'customer_id');
}
public function user()
{
return $this->belongsTo(User::class)->select(['id','name']);