1
This commit is contained in:
@@ -488,73 +488,73 @@ class Staff extends Controller {
|
||||
return $re;
|
||||
}
|
||||
|
||||
public function getgrtc(){
|
||||
// public function getgrtc(){
|
||||
|
||||
$staff_info = $this->staff_obj->where('name', $name)->where('state',0)->find();
|
||||
$baseprice = $this->getBasePrice($name);
|
||||
//获取实时期刊提成情况
|
||||
$c_time = strtotime("-1 month", strtotime(date('Y-m') . '-26 00:00:00'));
|
||||
$c_time1 = strtotime(date('Y-m' . '-25 23:59:59'));
|
||||
$where['ctime'] = array(['>', $c_time], ['<=', $c_time1]);
|
||||
$journals = $this->journal_obj->where('staff_id', $staff_info['staff_id'])->select();
|
||||
$journal_price = 0;
|
||||
$cite_price = 0;
|
||||
if($staff_info['type']==0){
|
||||
foreach ($journals as $v) {
|
||||
$c_price = 0;
|
||||
$where['accept_sn'] = ['like',$v['abbr'].'%'];
|
||||
$cache_articles = $this->article_obj->where($where)->select();
|
||||
// $staff_info = $this->staff_obj->where('name', $name)->where('state',0)->find();
|
||||
// $baseprice = $this->getBasePrice($name);
|
||||
// //获取实时期刊提成情况
|
||||
// $c_time = strtotime("-1 month", strtotime(date('Y-m') . '-26 00:00:00'));
|
||||
// $c_time1 = strtotime(date('Y-m' . '-25 23:59:59'));
|
||||
// $where['ctime'] = array(['>', $c_time], ['<=', $c_time1]);
|
||||
// $journals = $this->journal_obj->where('staff_id', $staff_info['staff_id'])->select();
|
||||
// $journal_price = 0;
|
||||
// $cite_price = 0;
|
||||
// if($staff_info['type']==0){
|
||||
// foreach ($journals as $v) {
|
||||
// $c_price = 0;
|
||||
// $where['accept_sn'] = ['like',$v['abbr'].'%'];
|
||||
// $cache_articles = $this->article_obj->where($where)->select();
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($cache_articles);
|
||||
echo '</pre>';
|
||||
// echo '<pre>';
|
||||
// var_dump($cache_articles);
|
||||
// echo '</pre>';
|
||||
|
||||
$c_gn = 0;
|
||||
$c_gw = 0;
|
||||
foreach ($cache_articles as $vv) {
|
||||
$c_country = $this->article_author_obj->where('article_id', $vv['article_id'])->where('state', 0)->column('country');
|
||||
$c_c = 'gn';
|
||||
foreach ($c_country as $vvv) {
|
||||
if ($vvv != 'China' && $vvv != '') {
|
||||
$c_c = 'gw';
|
||||
}
|
||||
}
|
||||
if ($c_c == 'gn') {
|
||||
$c_gn++;
|
||||
} else {
|
||||
$c_gw++;
|
||||
}
|
||||
}
|
||||
if ($c_gn - $v['jour_num'] >= 0) {
|
||||
$c_price = ($c_gn - $v['jour_num']) * 100 + $c_gw * 200;
|
||||
} else {
|
||||
if (($c_gw - ($v['jour_num'] - $c_gn)) >= 0) {
|
||||
$c_price = ($c_gn + $c_gw - $v['jour_num']) * 200;
|
||||
} else {
|
||||
$c_price = 0 - ($v['jour_num'] - $c_gn - $c_gw) * 50;
|
||||
}
|
||||
}
|
||||
$journal_price += $c_price;
|
||||
// $c_gn = 0;
|
||||
// $c_gw = 0;
|
||||
// foreach ($cache_articles as $vv) {
|
||||
// $c_country = $this->article_author_obj->where('article_id', $vv['article_id'])->where('state', 0)->column('country');
|
||||
// $c_c = 'gn';
|
||||
// foreach ($c_country as $vvv) {
|
||||
// if ($vvv != 'China' && $vvv != '') {
|
||||
// $c_c = 'gw';
|
||||
// }
|
||||
// }
|
||||
// if ($c_c == 'gn') {
|
||||
// $c_gn++;
|
||||
// } else {
|
||||
// $c_gw++;
|
||||
// }
|
||||
// }
|
||||
// if ($c_gn - $v['jour_num'] >= 0) {
|
||||
// $c_price = ($c_gn - $v['jour_num']) * 100 + $c_gw * 200;
|
||||
// } else {
|
||||
// if (($c_gw - ($v['jour_num'] - $c_gn)) >= 0) {
|
||||
// $c_price = ($c_gn + $c_gw - $v['jour_num']) * 200;
|
||||
// } else {
|
||||
// $c_price = 0 - ($v['jour_num'] - $c_gn - $c_gw) * 50;
|
||||
// }
|
||||
// }
|
||||
// $journal_price += $c_price;
|
||||
|
||||
//获取cite提成
|
||||
$jcites = json_decode(myPost(self::JURL,['issn'=>$v['issn']]));
|
||||
$jcs = $jcites->data->cites;
|
||||
$cite_price += count($jcs)*500;
|
||||
}
|
||||
// //获取cite提成
|
||||
// $jcites = json_decode(myPost(self::JURL,['issn'=>$v['issn']]));
|
||||
// $jcs = $jcites->data->cites;
|
||||
// $cite_price += count($jcs)*500;
|
||||
// }
|
||||
|
||||
echo '------------------------------------------------';
|
||||
}
|
||||
$re['staff_log_id'] = 0;
|
||||
$re['baseprice'] = $baseprice;
|
||||
$re['journalprice'] = $journal_price;
|
||||
$re['citeprice'] = $cite_price;
|
||||
$re['add_price'] = 0;
|
||||
$re['sub_price'] = 0;
|
||||
echo '<pre>';
|
||||
var_dump($re);
|
||||
echo '</pre>';
|
||||
die;
|
||||
}
|
||||
// echo '------------------------------------------------';
|
||||
// }
|
||||
// $re['staff_log_id'] = 0;
|
||||
// $re['baseprice'] = $baseprice;
|
||||
// $re['journalprice'] = $journal_price;
|
||||
// $re['citeprice'] = $cite_price;
|
||||
// $re['add_price'] = 0;
|
||||
// $re['sub_price'] = 0;
|
||||
// echo '<pre>';
|
||||
// var_dump($re);
|
||||
// echo '</pre>';
|
||||
// die;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user