更新报销模块

This commit is contained in:
yaooo 2023-12-19 11:36:34 +08:00
parent d706fafaaa
commit 9d6d42f5c9
2 changed files with 12 additions and 3 deletions

View File

@ -182,6 +182,10 @@ class ExpenseReimbursementLogic extends BaseLogic
*/ */
public static function detail($params): array public static function detail($params): array
{ {
return ExpenseReimbursement::findOrEmpty($params['id'])->toArray(); $expenseReimbursement = ExpenseReimbursement::findOrEmpty($params['id']);
$expenseReimbursement->detail;
$expenseReimbursement->invoice;
$expenseReimbursement->custom;
return $expenseReimbursement->toArray();
} }
} }

View File

@ -40,7 +40,7 @@ class ExpenseReimbursement extends BaseModel
public function detail() public function detail()
{ {
return $this->hasMany(\app\common\model\expense\ExpenseReimbursementDetail::class, 'expense_id', 'id'); return $this->hasMany(\app\common\model\expense\ExpenseReimbursementDetail::class, 'expense_id', 'id');
} }
/** /**
* @notes 关联invoice * @notes 关联invoice
@ -51,6 +51,11 @@ class ExpenseReimbursement extends BaseModel
public function invoice() public function invoice()
{ {
return $this->hasMany(\app\common\model\expense\ExpenseReimbursementInvoiceDetail::class, 'expense_id', 'id'); return $this->hasMany(\app\common\model\expense\ExpenseReimbursementInvoiceDetail::class, 'expense_id', 'id');
} }
public function custom()
{
return $this->belongsTo(\app\common\model\custom\Custom::class, 'customer_id');
}
} }