feat: 新增发票抬头、晒单、钱包日志等模型及后台管理功能
- 新增 invoice_title、showcase、wallet_log 模型及对应语言包 - 新增后台控制器、视图及搜索字段配置 - 修复服务类目删除保护逻辑 - 优化后台登录页面文案及样式 - 新增前端角色切换逻辑及页面拦截 - 新增 SVG 图标及样式变量 - 修复接口权限及下拉框默认值问题
这个提交包含在:
@@ -4,17 +4,11 @@ namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Invoice extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'invoice';
|
||||
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
@@ -26,21 +20,29 @@ class Invoice extends Model
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text',
|
||||
'title_type_text',
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['normal' => __('Ordinary'), 'special' => __('Special')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
public function getTitleTypeList()
|
||||
{
|
||||
return ['wait' => __('Wait'), 'issued' => __('Issued'), 'reject' => __('Reject')];
|
||||
return ['personal' => __('Personal'), 'enterprise' => __('Enterprise')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return [
|
||||
'wait' => __('Wait'),
|
||||
'issued' => __('Issued'),
|
||||
'reject' => __('Reject'),
|
||||
'cancel' => __('Cancel'),
|
||||
];
|
||||
}
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
@@ -49,6 +51,15 @@ class Invoice extends Model
|
||||
return $list[$value] ?? '';
|
||||
}
|
||||
|
||||
public function getTitleTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ?: ($data['title_type'] ?? '');
|
||||
if ($value === '' && !empty($data['tax_no'])) {
|
||||
$value = 'enterprise';
|
||||
}
|
||||
$list = $this->getTitleTypeList();
|
||||
return $list[$value] ?? __('Personal');
|
||||
}
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
@@ -57,10 +68,6 @@ class Invoice extends Model
|
||||
return $list[$value] ?? '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
|
||||
在新工单中引用
屏蔽一个用户