作者 lyh

更新修改

... ... @@ -80,7 +80,7 @@ class TemplateLog extends Command
* @time :2024/11/13 16:19
*/
public function deleteUserLog(){
$date = date('Y-m-d H:i:s', strtotime('-60 days'));
$date = date('Y-m-d H:i:s', strtotime('-30 days'));
$userLogModel = new UserLog();
return $userLogModel->del(['created_at'=>['<=',$date]]);
}
... ...
... ... @@ -72,12 +72,26 @@ class CountAllProject extends Command
$arr = explode('.',$v['category']);
if($arr[0] == 1){
$v['status'] = 1;
$v['category'] = $arr[1] ?? '';
}elseif ($arr[0] == 2){
$v['status'] = 2;
}
$v['category'] = $arr[1] ?? '';
}elseif($arr[0] == 3){
$v['status'] = 3;
$v['category'] = $arr[1] ?? '';
}elseif ($arr[0] == 4){
$v['status'] = 7;
$v['category'] = '续费记录单';
}elseif ($arr[0] == 5){
$v['status'] = 4;
$v['category'] = '推广续网站';
}elseif ($arr[0] == 6){
$v['status'] = 5;
$v['category'] = '未续费项目';
}else{
$v['status'] = 6;
$v['category'] = '特殊推广项目';
}
}
if($v['is_admin5'] == 5){
$v['version'] = 2;
... ... @@ -85,7 +99,6 @@ class CountAllProject extends Command
$v['version'] = 3;
}
$v['is_upgrade'] = 0;
$v['status'] = 0;
$v['created_at'] = $v['updated_at'] = date('Y-m-d H:i:s');
$data[$k] = $v;
}
... ... @@ -142,6 +155,31 @@ class CountAllProject extends Command
$data = [];
echo '执行页数:' . $i . PHP_EOL . date('Y-m-d H:i:s') . PHP_EOL;
foreach ($lists['list'] as $k => $v){
if(!empty($v['type'])){
if($v['type'] == 1){
$type = 1;
$category = '建站进程中';
}elseif ($v['type'] == 2){
$type = 2;
$category = '已完成 - 推广进程中';
}elseif($v['type'] == 3){
$type = 3;
$category = '已完成 - 建站用户';
}elseif ($v['type'] == 4){
$type = 4;
$category = '推广续网站';
}elseif ($v['type'] == 5){
$type = 5;
$category = '未续费项目';
}elseif ($v['type'] == 6){
$type = 6;
$category = '特殊推广项目';
}else{
$type = 7;
$category = '续费记录单';
}
}
$channel = Channel::getChannelText($v['channel']['user_id'] ?? 0);
$data[] = [
'project_id'=>$v['id'],
'version'=>1,//代表6.0
... ... @@ -149,13 +187,15 @@ class CountAllProject extends Command
'title'=>$v['title'],
'company'=>$v['company'],
'channel'=>Channel::getChannelText($v['channel']['user_id'] ?? 0),
'sale'=>$this->end_channel($channel) ?? '',
'join_date'=>$v['cooperate_date'],
'online_date'=>$v['uptime'],
'keywords_num'=>$v['key'],
'service_num'=>$v['day'],
'production_num'=>intval(abs((empty($v['uptime']) ? time() : strtotime($v['uptime'])) - strtotime($v['created_at'])) / 86400),
'plan'=>Project::planMap()[$v['plan']],
'status'=>0,
'status'=>$type,
'category'=>$category,
'test_domain'=>$v['test_domain'],
'product_domain'=>!empty($v['domain']) ? (new DomainInfo())->getDomain($v['domain']) : '',
'project_manager'=>$manageModel->getName($v['manager_mid'] ?? ''),
... ... @@ -219,7 +259,10 @@ class CountAllProject extends Command
}
public function end_channel($channel){
if(!empty($channel)){
$parts = explode("-", $channel);
return end($parts);
}
return $channel;
}
}
... ...
... ... @@ -31,8 +31,8 @@ class DetailController extends BaseController
],[
'product_id.required' => '产品id不能为空',
]);
$data = $detail->list($this->map,'sort',['*'],'asc');
$data_column = $column->list([],'id',['*'],'asc');
$data = $detail->list($this->map,'sort',['*'],'asc');
if(!empty($data_column) && !empty($data)){
foreach ($data_column as $k => $v){
$column_data = [];
... ...
... ... @@ -189,7 +189,7 @@ class ManageHr extends Base
* @time :2023/8/18 14:41
*/
public function getName($id){
$name = '';
$name = '未分配';
if(!empty($id)){
$name = Cache::get('manager_hr_'.$id);
if(empty($name)){
... ...