作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -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]]);
}
... ...
... ... @@ -68,13 +68,40 @@ class CountAllProject extends Command
if(empty($v['online_date'])){
$v['online_date'] = null;
}
if(!empty($v['category'])){
$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'] = '特殊推广项目';
}
}else{
$v['status'] = 0;
$v['category'] = $v['category'];
}
if($v['is_admin5'] == 5){
$v['version'] = 2;
}else{
$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;
}
... ... @@ -131,6 +158,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
... ... @@ -138,13 +190,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'] ?? ''),
... ... @@ -208,7 +262,10 @@ class CountAllProject extends Command
}
public function end_channel($channel){
if(!empty($channel)){
$parts = explode("-", $channel);
return end($parts);
}
return $channel;
}
}
... ...
... ... @@ -17,8 +17,8 @@ class Translate
{
//接口地址
// public static $url = 'https://translate.hbb618.cn/translates';
public static $url = 'https://api.cmer.com/';
// public static $url = 'https://api.cmer.com/';
public static $url = ' https://apius.ai.cc/';
public static $header = array(
'accept: application/json',
'Content-Type: application/json',
... ...
... ... @@ -25,16 +25,27 @@ class DetailController extends BaseController
* @method :post
* @time :2024/11/13 9:53
*/
public function getDetail(Detail $detail){
public function getDetail(Detail $detail,Column $column){
$this->request->validate([
'product_id'=>'required',
'column_id'=>'required'
],[
'product_id.required' => '产品id不能为空',
'column_id.required' => '栏目id不能为空',
]);
$data_column = $column->list([],'id',['*'],'asc');
$data = $detail->list($this->map,'sort',['*'],'asc');
$this->response('success',Code::SUCCESS,$data);
if(!empty($data_column) && !empty($data)){
foreach ($data_column as $k => $v){
$column_data = [];
foreach ($data as $v1){
if($v['id'] == $v1['column_id']){
$column_data[] = $v1;
}
}
$v['data'] = $column_data;
$data_column[$k] = $v;
}
}
$this->response('success',Code::SUCCESS,$data_column);
}
/**
... ...
... ... @@ -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)){
... ...