市场专员业绩计bug修正

master
zhengyongxing 4 years ago
parent 962d140d80
commit de3d7d52b7

@ -735,7 +735,6 @@ class MarketPercentageController extends ThinkController
$data[$key]['extend_commission'] +=$wait_amount[$value['admin_id'] . date("Y-m",strtotime("last month",strtotime($value['pay_time'])))];
}
$insert['pay_time'] = $data[$key]['pay_time'];
$insert['admin_id'] = $data[$key]['admin_id'];
$insert['real_name'] = $data[$key]['real_name'];
@ -787,15 +786,14 @@ class MarketPercentageController extends ThinkController
->join("left join sys_member member on access.uid=member.uid")
->where(['pay_time'=>$_REQUEST['pay_time'],'admin_id'=>$_REQUEST['admin_id']])
->select();
// dump($map['pay_time']);die();
// dump($data);die();
foreach($data as $key => $value) {
$sign = 0;
if (!$data[$key]['extend_commission']) {
if ($value['extend_commission']=='0.00') {
$sign = 1;
}
$market_percentage = json_decode($value['market_percentage'],true);
// $month = date("m",strtotime($value['pay_time']));
if ($market_percentage['time'] == 1) {
if ($month == '07') {
@ -829,6 +827,7 @@ class MarketPercentageController extends ThinkController
}
$update['extend_commission'] = $data[$key]['extend_commission'];
// var_dump($sign);
if ($sign) {
M("market_altogether","tab_")
->where(['pay_time'=>$data[$key]['pay_time'],'admin_id'=>$data[$key]['admin_id']])

@ -969,7 +969,7 @@ class TimingController extends AdminController {
$i = 0;
do {
$date = date('Y-m', strtotime($start . ' + ' . $i . ' month'));
echo "{$date}:";
echo "{$date}:\n";
$i++;
$map['pay_time'] = $date;
@ -1138,6 +1138,11 @@ class TimingController extends AdminController {
foreach($data as $key => $value) {
// $sign = 0;
// if ($value['extend_commission']=='0.00') {
// $sign = 1;
// }
$market_percentage = json_decode($value['market_percentage'],true);
if ($market_percentage['time'] == 1) {
@ -1224,6 +1229,12 @@ class TimingController extends AdminController {
$update['extend_commission'] = $data[$key]['extend_commission'];
// if ($sign) {
// M("market_altogether","tab_")
// ->where(['pay_time'=>$data[$key]['pay_time'],'admin_id'=>$data[$key]['admin_id']])
// ->save($update);
// }
M("market_altogether","tab_")
->where(['pay_time'=>$data[$key]['pay_time'],'admin_id'=>$data[$key]['admin_id']])
->save($update);

Loading…
Cancel
Save