Merge branch 'develop'

# Conflicts:
#	app/admin/controller/dashboard/FinStatisticsController.php
#	app/common/controller/FinPaymentApplyController.php
#	app/common/controller/FinReceiptController.php
#	app/common/logic/FinReceiptLogic.php
#	app/common/model/FinPaymentApply.php
#	app/common/model/FinReceipt.php
#	app/common/service/FinPaymentApplyService.php
#	app/common/service/FinReceiptService.php
#	app/common/service/StockOrdersService.php
#	config/route.php
This commit is contained in:
mzl
2025-11-04 10:36:52 +08:00
parent 359755fdf1
commit aabd0f4634
10 changed files with 321 additions and 39 deletions
+12 -1
View File
@@ -2,10 +2,12 @@
namespace app\common\model;
use Illuminate\Database\Eloquent\SoftDeletes;
use support\Model;
class FinPaymentApply extends Model
{
use SoftDeletes;
/**
* The connection name for the model.
*
@@ -40,7 +42,7 @@ class FinPaymentApply extends Model
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'apply_no', 'doc_user_id', 'sales_user_id', 'corp_id', 'account_id', 'payment_account', 'payment_entity', 'entity_type', 'currency_id', 'amount', 'swift', 'remit_bank', 'country_id', 'remitter', 'exchange_rate', 'total_amount_cny', 'voucher_file', 'voucher_name', 'submit_files','receipt_id','claimed_at','warn', 'created_at', 'updated_at', 'claimed_by',];
protected $fillable = ['id', 'apply_no', 'doc_user_id', 'sales_user_id', 'corp_id', 'account_id', 'payment_account', 'payment_entity', 'entity_type', 'currency_id', 'amount', 'swift', 'remit_bank', 'country_id', 'remitter', 'exchange_rate', 'total_amount_cny', 'voucher_file', 'voucher_name', 'submit_files','receipt_id','claimed_at','warn', 'received_at', 'created_at', 'updated_at', 'deleted_at', 'claimed_by', 'created_by',];
/**
* 不允许自动填充模型字段
@@ -62,4 +64,13 @@ class FinPaymentApply extends Model
{
return $this->belongsToMany(StockOrders::class, 'fin_payment_stock', 'payment_apply_id', 'stock_id');
}
/**
* 查询 submit_files 不为空的记录
*/
public function scopeWithNonEmptyFiles($query)
{
return $query->whereNotNull('submit_files')
->whereRaw('JSON_LENGTH(submit_files) > 0');
}
}
+17 -1
View File
@@ -40,7 +40,7 @@ class FinReceipt extends Model
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'receipt_no', 'payment_apply_id', 'country_id', 'remitter', 'account_id', 'currency_id', 'amount', 'discount_amount', 'total_amount_cny', 'exchange_rate', 'arrived_at', 'received_at', 'voucher_no', 'fx_receipt_file', 'fx_receipt_file_name', 'is_domestic_return', 'created_by', 'updated_by', 'created_at', 'updated_at'];
protected $fillable = ['id', 'receipt_no', 'payment_apply_id', 'country_id', 'remitter', 'account_id', 'currency_id', 'amount', 'discount_amount', 'total_amount_cny', 'exchange_rate', 'arrived_at', 'received_at', 'voucher_no', 'fx_receipt_file', 'fx_receipt_file_name', 'is_domestic_return', 'submit_files', 'created_by', 'updated_by', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
@@ -62,4 +62,20 @@ class FinReceipt extends Model
{
return $this->belongsToMany(StockOrders::class, 'fin_payment_stock', 'receipt_id', 'stock_id');
}
/**
* 关联付款申请
*/
// public function finPaymentApply()
// {
// return $this->hasOne(FinPaymentApply::class, 'receipt_id', 'id');
// }
/**
* 关联付款申请表
*/
public function paymentApply()
{
return $this->belongsTo(FinPaymentApply::class, 'payment_apply_id', 'id');
}
}