fixed 编辑入股任务回显

This commit is contained in:
chenbo 2023-11-25 16:10:19 +08:00
parent d54aa707aa
commit 16423d0185
2 changed files with 16 additions and 4 deletions

View File

@ -19,6 +19,7 @@ use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\task_template\TaskTemplate;
use app\common\lists\ListsSearchInterface;
use app\common\model\task_scheduling\TaskScheduling;
use app\common\model\user\User;
/**
* 任务模板列表
@ -59,6 +60,16 @@ class TaskTemplateLists extends BaseAdminDataLists implements ListsSearchInterfa
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->append(['task_admin_name'])
->withAttr("task_admin_name", function ($value,$data) {
if ($data['type'] == 35) {
$extend = json_decode($data['extend'], true);
$userName = User::where('id', $extend['shareholder']['user_id'])->value('nickname');
return $userName;
} else {
return '';
}
})
->toArray();
}

View File

@ -16,6 +16,7 @@ namespace app\adminapi\lists\user;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\user\UserTerminalEnum;
use app\common\lists\ListsExcelInterface;
use app\common\model\Company;
use app\common\model\contract\Contract;
use app\common\model\user\User;
use think\facade\Db;
@ -37,7 +38,7 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface
*/
public function setSearch(): array
{
$allowSearch = ['keyword', 'channel', 'create_time_start', 'create_time_end'];
$allowSearch = ['keyword', 'channel', 'create_time_start', 'create_time_end', 'company_id'];
return array_intersect(array_keys($this->params), $allowSearch);
}
@ -69,11 +70,11 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface
}
$field = "id,id contract,sn,nickname,sex,avatar,account,mobile,channel,create_time,admin_id,company_id,street,street as street_name,is_contract";
$lists = User::withSearch($this->setSearch(), $this->params)
->with(['company'])
->where($where)
->limit($this->limitOffset, $this->limitLength)
->field($field)
->where($where)
->with(['company'])
->order('id desc')
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();