Commit d102899b authored by hujun's avatar hujun

设置

parent 558ceb98
...@@ -25,86 +25,6 @@ class Setting extends Basic ...@@ -25,86 +25,6 @@ class Setting extends Basic
$this->m_config = new SystemConfig(); $this->m_config = new SystemConfig();
} }
/**
* 显示视图,新增和编辑设置数据
*
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getSetting() {
if ($this->request->isAjax()) {
$data = [];
if ($this->request->isGet()) {
//获取数据
$data = $this->m_config->getSetting();
} else {
//新增或编辑数据
$data['is_privacy'] = (int)$this->params['is_privacy'];
$data['day_num'] = (int)$this->params['day_num'];
$data['down_time'] = $this->params['down_time'];
$data['landlord_phone_day'] = (int)$this->params['landlord_phone_day'];
$data['agent_call_day'] = (int)$this->params['agent_call_day'];
$data['agent_call_number'] = (int)$this->params['agent_call_number'];
$config_data = [];
$config_data[0]['id'] = 1;
$config_data[0]['config_name'] = '商铺自动下架天数';
$config_data[0]['config_type'] = 10;
$config_data[0]['rule'] = json_encode(['down_time'=>$data['down_time']]);
$config_data[0]['agent_id'] = $this->userId;
$config_data[1]['id'] = 2;
$config_data[1]['config_name'] = '隐私号码';
$config_data[1]['config_type'] = 20;
$config_data[1]['rule'] = json_encode([
'is_privacy'=>$data['is_privacy'],
'day_num'=>$data['day_num'],
'landlord_phone_day'=>$data['landlord_phone_day'],
'agent_call_day'=>$data['agent_call_day'],
'agent_call_number'=>$data['agent_call_number']
]);
$config_data[1]['agent_id'] = $this->userId;
$config_data[2]['id'] = 3;
$config_data[2]['config_name'] = '新客户保护期有效小时数';
$config_data[2]['config_type'] = 30;
$new_client_hours = $this->params['new_client_hours'];
$config_data[2]['rule'] = json_encode(['new_client_hours'=>$new_client_hours]);
$config_data[2]['agent_id'] = $this->userId;
$config_data[3]['id'] = 4;
$config_data[3]['config_name'] = '业务员最多可查看的商铺数量';
$config_data[3]['config_type'] = 40;
$agent_shop_num = empty($this->params['agent_shop_num']) ? 5 : $this->params['agent_shop_num'];
$config_data[3]['rule'] = json_encode(['agent_shop_num'=>$agent_shop_num]);
$config_data[3]['agent_id'] = $this->userId;
$this->m_config->insertSetting($config_data, true);
$look = new LookShopService();
$look->setLookNum($agent_shop_num);
$redis = RedisExt::getRedis();
$redis->set('s_down_time', $data['down_time']); //商铺自动下架天数
$redis->set('s_is_privacy', $data['is_privacy']); //是否使用隐号系统
$redis->set('s_day_num', $data['day_num']); //客户隐号绑定有效期(天数):
$redis->set('s_landlord_phone_day', $data['landlord_phone_day']); //房东隐号绑定有效期(天数):
$redis->set('s_new_client_hours', $new_client_hours); //新客户保护期有效小时数
$redis->set('s_lookNum', $agent_shop_num); //业务员最多可查看的商铺数量
$redis->set('s_agent_call_day', $data['agent_call_day']); //业务员多少天可以打多少电话
$redis->set('s_agent_call_number', $data['agent_call_number']); //业务员多少天可以打多少电话
}
return $this->response(200, '', $data);
} else {
//视图显示
return view('setting/index');
}
}
/** /**
* 系统设置 * 系统设置
* *
...@@ -169,6 +89,8 @@ class Setting extends Basic ...@@ -169,6 +89,8 @@ class Setting extends Basic
$redis->set('s_agent_call_day', $data['agent_call_day']); //业务员多少天可以打多少电话 $redis->set('s_agent_call_day', $data['agent_call_day']); //业务员多少天可以打多少电话
$redis->set('s_agent_call_number', $data['agent_call_number']); //业务员多少天可以打多少电话 $redis->set('s_agent_call_number', $data['agent_call_number']); //业务员多少天可以打多少电话
$redis->set('s_agent_suspend', $data['agent_suspend']); //业务员多少天可以打多少电话 $redis->set('s_agent_suspend', $data['agent_suspend']); //业务员多少天可以打多少电话
$redis->set('s_video_start_time', $data['video_start_time']); //视频开始秒数
$redis->set('s_video_end_time', $data['video_end_time']); //视频结束秒数
return ; return ;
} }
......
...@@ -207,10 +207,12 @@ class JobTask ...@@ -207,10 +207,12 @@ class JobTask
$pageTotal = ceil($total / $pageSize); $pageTotal = ceil($total / $pageSize);
$path = ROOT_PATH.'public/resource/lib/Attachments/video/'; $path = ROOT_PATH.'public/resource/lib/Attachments/video/';
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) { for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$data = $m_house_video->getList($pageNo, $pageSize, '', 'id,video_name', $where); $data = $m_house_video->getList($pageNo, $pageSize, '', 'id,video_name,video_images', $where);
foreach ($data as $k=>$v) { foreach ($data as $k=>$v) {
$del_file = $path.$v['video_name']; $del_file = $path.$v['video_name'];
$del_file_img = $path.$v['video_images'];
@unlink($del_file); @unlink($del_file);
@unlink($del_file_img);
if (!file_exists($del_file)) { if (!file_exists($del_file)) {
$m_house_video->updateData(['is_del'=>2], ['id'=>$v['id']]); $m_house_video->updateData(['is_del'=>2], ['id'=>$v['id']]);
} }
......
...@@ -57,6 +57,12 @@ ...@@ -57,6 +57,12 @@
<div class="col-sm-8"> <div class="col-sm-8">
<input type="number" class="form-control btn5" name="agent_suspend" placeholder="帐号自动冻结,客户跟进数量" value="[%= JSON.parse(it[item]['rule']).agent_suspend %]"> <input type="number" class="form-control btn5" name="agent_suspend" placeholder="帐号自动冻结,客户跟进数量" value="[%= JSON.parse(it[item]['rule']).agent_suspend %]">
</div> </div>
[% } else if (it[item]['params'] == 'video_time') { %]
<label class="col-sm-4 control-label" style="text-align: right">视频开始结束时间:</label>
<div class="col-sm-8">
<input type="number" class="form-control btn5" name="video_start_time" placeholder="帐号自动冻结,客户跟进数量" value="[%= JSON.parse(it[item]['rule']).video_start_time %]">
<input type="number" class="form-control btn5" name="video_end_time" placeholder="帐号自动冻结,客户跟进数量" value="[%= JSON.parse(it[item]['rule']).video_end_time %]">
</div>
[% } %] [% } %]
[% } %] [% } %]
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment