Merge branch 'master' into feature/qrcode_promotion

master
tping 3 years ago
commit d325ac9a4a

@ -758,8 +758,10 @@ class ConsoleController extends Think {
public function shiftPromote()
{
$fromAccount = 'longyan';
$toAccount = 'nola2021';
return;
$fromAccount = 'hskj6868'; //1874
$toAccount = 'huyou1'; //1068
$shiftIds = [3706];
$formPromote = M('promote', 'tab_')->where(['account' => $fromAccount])->find();
$toPromote = M('promote', 'tab_')->where(['account' => $toAccount])->find();
@ -768,23 +770,24 @@ class ConsoleController extends Think {
var_dump([
'from_promote_id' => $formPromote['id'],
'to_promote_id' => $toPromote['id'],
'shift_ids' => '',
'shift_ids' => json_encode($shiftIds),
]);
$service = new PromoteService();
$service->shiftPromote([
'from_promote_id' => $formPromote['id'],
'to_promote_id' => $toPromote['id'],
'shift_ids' => '',
'shift_ids' => json_encode($shiftIds),
]);
M('promote', 'tab_')->where(['level1_id' => $formPromote['id'], 'company_id' => $formPromote['company_id']])->save([
M('promote', 'tab_')->where(['level1_id' => $toPromote['id'], 'level2_id' => 3706, 'company_id' => $formPromote['company_id']])->save([
'company_id' => $toPromote['company_id'],
'admin_id' => $toPromote['admin_id'],
]);
if (count($ids)) {
$orderTime = strtotime('2021-08-01 00:00:00');
/* if (count($ids)) {
$orderTime = strtotime('2021-09-01 00:00:00');
M('deposit', 'tab_')->where(['promote_id' => ['in', $ids], 'create_time' => ['egt', $orderTime]])->save(['market_admin_id' => $toPromote['admin_id']]);
M('spend', 'tab_')->where(['promote_id' => ['in', $ids], 'spend_time' => ['egt', $orderTime]])->save(['market_admin_id' => $toPromote['admin_id']]);
}
} */
}
}

@ -519,16 +519,16 @@ class MarketPercentageController extends ThinkController
unset($_GET['is_get']);
$data = $_GET;
$if_coefficientSave = M("market_altogether", "tab_")
->where([
'pay_time' => $pay_time,
'market_check' => 1
])
->find();
if ($if_coefficientSave) {
$this->ajaxReturn(['status' => 0, 'msg' => "市场部已确认,绩效系数再不可修改"]);
}
// $if_coefficientSave = M("market_altogether", "tab_")
// ->where([
// 'pay_time' => $pay_time,
// 'market_check' => 1
// ])
// ->find();
// if ($if_coefficientSave) {
// $this->ajaxReturn(['status' => 0, 'msg' => "市场部已确认,绩效系数再不可修改"]);
// }
$admin = $_SESSION['onethink_admin']['user_auth']['username'];
$coefficient_check_detail = "已审批({$admin}<br>" . date("Y-m-d H:i:s", time());
@ -583,9 +583,19 @@ class MarketPercentageController extends ThinkController
} else {
$uids = M("market_altogether", "tab_")
->where([
'pay_time' => $pay_time,
'market_check' => 0
])
->getField('admin_id',true);
if($uids){
$uids = implode(",",$uids);
$map['_string'] = "sys_auth_group_access.uid in ({$uids})";
}
$map['sys_auth_group_access.uid'] =['in',$this->MarketEvent->getAdminidByLeaderid()];
$map['auth.id'] =['in',$this->MarketEvent->getNoLeaderMarketGroupId()];
$data = M("auth_group_access")
->field("sys_member.nickname,sys_member.real_name,sys_member.uid,sys_auth_group_access.group_id,IF(coefficient is not NULL, coefficient, 100) coefficient,sys_ucenter_member.leave_time")
->join("left join sys_auth_group auth on auth.id = sys_auth_group_access.group_id")

@ -1076,19 +1076,20 @@ class TimingController extends AdminController {
$group_config = json_decode($group_config['market_percentage'],true);
$month = date("m",strtotime($value['pay_time']));
$yes = date("Y",strtotime($value['pay_time']));
$where =[];
if ($group_config['time'] == 1) {
// var_dump($month);die();
if ($month == '07') {
$where = [$yes.'-'.'01',$yes.'-'.'02',$yes.'-'.'03'];
} elseif($month == '10') {
$where = [$yes.'-'.'04',$yes.'-'.'05',$yes.'-'.'06'];
} elseif($month == '04') {
}
if($month == '10') {
$where = [$yes.'-'.'07',$yes.'-'.'08',$yes.'-'.'09'];
}
if($month == '04') {
$where = [$yes.'-'.'01',$yes.'-'.'02',$yes.'-'.'03'];
}
if($month == '01') {
$where = [($yes-1).'-'.'10',($yes-1).'-'.'11',($yes-1).'-'.'12'];
} elseif($month == '01') {
$where = [($yes-1).'-'.'07',($yes-1).'-'.'08',($yes-1).'-'.'09'];
}
} elseif($group_config['time'] == 2) {

@ -103,9 +103,11 @@
<tbody id="statementShow">
<if condition = "empty($list_data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="16" class="text-center">aOh! 暂时无需要确认的绩效!</td>
</tr>
</if>
</tbody>
</table>
<else />
<volist name="list_data" id="data">
<tr <if condition = "$data.is_hide eq 1"> style="display:none;" </if>>
<td >{$data['real_name']}</td>
@ -117,6 +119,8 @@
<div class="jssearch fr cf search_list" style="width: 100%;">
<a class="sch-btn" id="confimBtn" url="{:U('coefficientSave')}" style="width: 120px;margin-top: 20px;margin-right: 20px;float: right;">提交保存</a>
</div>
</if>
</form>
</div>
</div>

@ -227,7 +227,7 @@
<tbody>
<if condition = "empty($list_data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="16" class="text-center">aOh! 暂时无需要确认数据。</td>
</tr>
</if>
<notemtpy name = "list_data">

@ -236,11 +236,13 @@ class PromoteService {
return ['status' => false, 'msg' => '系统异常, 处理推广员平台币失败'];
} */
$levelColumn = 'level' . $toPromote['level'] . '_id';
$subLevelColumn = 'level' . ($toPromote['level'] + 1) . '_id';
$firstMap = ['parent_id' => $fromPromote['id']];
$secondMap = ['chain' => ['like', $fromPromote['chain'] . $fromPromote['id'] . '/%']];
if (count($shiftIds) > 0) {
$firstMap['id'] = ['in', $shiftIds];
$secondMap['parent_id'] = ['in', $shiftIds];
$secondMap[$subLevelColumn] = ['in', $shiftIds];
}
try {
@ -248,12 +250,12 @@ class PromoteService {
'parent_id' => $toPromote['id'],
'parent_name' => $toPromote['account'],
'chain' => $toPromote['chain'] . $toPromote['id'] . '/',
'level' . $toPromote['level'] => $toPromote['id']
$levelColumn => $toPromote['id']
]);
M('promote', 'tab_')->where($secondMap)->save([
'chain' => ['exp', 'REPLACE(chain, "/' . $fromPromote['id'] . '/","/' . $toPromote['id'] . '/")'],
'level' . $toPromote['level'] . '_id' => $toPromote['id']
$levelColumn => $toPromote['id']
]);
$model->commit();

Loading…
Cancel
Save