|
|
@@ -7,7 +7,9 @@
|
|
|
namespace app\common\model\master_worker;
|
|
|
|
|
|
use app\common\model\BaseModel;
|
|
|
+use app\common\model\dict\DictData;
|
|
|
use app\common\model\MasterWorkerRegister;
|
|
|
+use think\facade\Cache;
|
|
|
|
|
|
/**
|
|
|
* 师傅表
|
|
|
@@ -35,4 +37,26 @@ class MasterWorker extends BaseModel
|
|
|
return $this->hasOne(MasterWorkerRegister::class, 'worker_id', 'id');
|
|
|
}
|
|
|
|
|
|
+ public function getRetentionMoneyStatusTextAttr($value,$data):string{
|
|
|
+ $default = Cache::get('RETENTION_MONEY_STATUS');
|
|
|
+ if (!$default) {
|
|
|
+ $status = DictData::whereIn('type_value', 'retention_money_status')->column('name','value');
|
|
|
+ Cache::set('RETENTION_MONEY_STATUS', json_encode($status,true),5);
|
|
|
+ } else {
|
|
|
+ $status = json_decode($default);
|
|
|
+ }
|
|
|
+ return $status[$data['retention_money_status']] ?? '';
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getRetentionPayStatusTextAttr($value,$data):string{
|
|
|
+ $default = Cache::get('RETENTION_PAY_STATUS');
|
|
|
+ if (!$default) {
|
|
|
+ $status = DictData::whereIn('type_value', 'retention_pay_status')->column('name','value');
|
|
|
+ Cache::set('RETENTION_PAY_STATUS', json_encode($status,true),5);
|
|
|
+ } else {
|
|
|
+ $status = json_decode($default);
|
|
|
+ }
|
|
|
+ return $status[$data['retention_pay_status']] ?? '';
|
|
|
+ }
|
|
|
+
|
|
|
}
|