Merge branch 'develop' into feature/stock_next

This commit is contained in:
2025-09-12 15:15:14 +08:00
80 changed files with 7446 additions and 1234 deletions
+3 -15
View File
@@ -43,21 +43,9 @@ class StockOrderItems extends Model
*/
protected $fillable = [
'id', 'order_id', 'product_code', 'sku_id', 'sku_snapshot',
'model_snapshot', 'quantity', 'color_interior_coide', 'color_interior_snapshot',
'color_exterior_coide', 'color_exterior_snapshot', 'remark',
// 'unit_price',
// 'handling_fee',
// 'fob_transport_fee',
// 'port_misc_fee',
// 'retrofit_fee',
// 'total_price',
'created_at', 'updated_at',
// 'unit_price_value_id',
// 'handling_fee_value_id',
// 'fob_transport_fee_value_id',
// 'port_misc_fee_value_id',
// 'retrofit_fee_value_id',
// 'total_price_value_id'
'model_snapshot', 'quantity', 'color_interior_code', 'color_interior_snapshot',
'color_exterior_code', 'color_exterior_snapshot', 'remark', 'vin', 'created_at', 'updated_at',
'mileage', 'unique_id'
];
/**
+15 -1
View File
@@ -3,6 +3,7 @@
namespace app\common\model;
use support\Model;
use app\common\traits\HasMoneyJournal;
class StockOrders extends Model
{
@@ -49,7 +50,7 @@ class StockOrders extends Model
'trade_term_id', 'trade_term_snapshot', 'clearance_port_id', 'clearance_port_snapshot',
'latest_arrival_date', 'contract_exchange_rate', 'settlement_currency', 'status',
'remark', 'created_at', 'updated_at', 'deleted_at',
'object_id', 'contract', 'is_use', 'is_final', 'approval_status'
'object_id', 'contract', 'is_use', 'is_final', 'approval_status', 'file_url', 'pick_up_date', 'collect_all_date', 'profit_total'
];
/**
@@ -58,6 +59,13 @@ class StockOrders extends Model
protected $guarded = [];
use HasMoneyJournal;
// 实现抽象方法
protected static function moneyObjectScene(): string
{
return 'stock_orders';
}
/**
* 关联订单项
*/
@@ -81,4 +89,10 @@ class StockOrders extends Model
{
return $this->hasMany(VehMoneyValue::class, 'object_id', 'id')->where('object_scene', 'stock_orders');
}
public function salesperson()
{
return $this->hasOne(User::class, 'id', 'salesperson_id');
}
}
@@ -0,0 +1,49 @@
<?php
namespace app\common\model;
use support\Model;
class SysCurrencyTranslation extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'sys_currency_translation';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'currency_id', 'locale', 'currency_name', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
}
+6
View File
@@ -56,4 +56,10 @@ class SysDict extends Model
{
return $this->hasMany(SysDictItem::class, 'dict_id', 'id');
}
public function category()
{
return $this->belongsTo(SysDictCategory::class, 'category_id', 'id');
}
}
+9
View File
@@ -46,4 +46,13 @@ class SysDictCategory extends Model
* 不允许自动填充模型字段
*/
protected $guarded = [];
public function dicts()
{
return $this->hasMany(SysDict::class, 'category_id', 'id')
->where('status', 1)
->whereNull('deleted_at')
->orderBy('id', 'asc');
}
}
@@ -0,0 +1,49 @@
<?php
namespace app\common\model;
use support\Model;
class SysDictItemTranslation extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'sys_dict_translation';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'dict_id', 'remark', 'locale', 'dict_name', 'description', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
}
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace app\common\model;
use support\Model;
class SysDictTranslation extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'sys_dict_translation';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'dict_id', 'locale', 'dict_name', 'description', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
}
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace app\common\model;
use support\Model;
class SysPortTranslation extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'sys_port_translation';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'port_id', 'locale', 'port_name', 'description', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
}
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace app\common\model;
use support\Model;
class VehColorTranslation extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'veh_color_translation';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'color_id', 'locale', 'color_text', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
}