update
This commit is contained in:
parent
8fbcb27651
commit
1133e73ec2
@ -16,6 +16,7 @@
|
||||
|
||||
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\financial\FinancialBudgetDocDetail;
|
||||
use think\facade\Db;
|
||||
|
||||
@ -108,6 +109,10 @@
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
return FinancialBudgetDocDetail::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id'])->toArray();
|
||||
$data = FinancialBudgetDocDetail::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']);
|
||||
$dept = Dept::field('name')->where('id', $data['dept_id'])->findOrEmpty();
|
||||
$data['dept_name'] = $dept['name'];
|
||||
$data['type_text'] = $data->type_text;
|
||||
return $data->toArray();
|
||||
}
|
||||
}
|
@ -11,24 +11,30 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\financial;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--项目预算书--预算明细模型
|
||||
* Class FinancialBudgetDocDetail
|
||||
* @package app\common\model\financial
|
||||
*/
|
||||
class FinancialBudgetDocDetail extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
protected $name = 'financial_budget_doc_detail';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
}
|
||||
|
||||
namespace app\common\model\financial;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\dict\DictData;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--项目预算书--预算明细模型
|
||||
* Class FinancialBudgetDocDetail
|
||||
* @package app\common\model\financial
|
||||
*/
|
||||
class FinancialBudgetDocDetail extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $name = 'financial_budget_doc_detail';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$dict = DictData::where('type_value', 'budget_share_method')->column('name', 'value');
|
||||
return !empty($data['type']) ? $dict[$data['type']] : '';
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user