|
|
|
@ -187,13 +187,19 @@ class PromoteService {
|
|
|
|
|
$secondMap['parent_id'] = ['in', $shiftIds];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$status = M('promote', 'tab_')->where($firstMap)->save(['parent_id' => $toPromote['id'], 'parent_name' => $toPromote['account']]);
|
|
|
|
|
$status = M('promote', 'tab_')->where($firstMap)->save([
|
|
|
|
|
'parent_id' => $toPromote['id'],
|
|
|
|
|
'parent_name' => $toPromote['account'],
|
|
|
|
|
'chain' => $toPromote['chain'] . $toPromote['id'] . '/'
|
|
|
|
|
]);
|
|
|
|
|
if (!$status) {
|
|
|
|
|
$model->rollback();
|
|
|
|
|
return ['status' => false, 'msg' => '系统异常,修改推广员上级失败'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$status = M('promote', 'tab_')->where($secondMap)->save(['chain' => $toPromote['chain'] . $toPromote['id'] . '/']);
|
|
|
|
|
$status = M('promote', 'tab_')->where($secondMap)->save([
|
|
|
|
|
'chain' => ['exp', 'REPLACE(chain, "/' . $fromPromote['id'] . '/","/' . $toPromote['id'] . '/")'],
|
|
|
|
|
]);
|
|
|
|
|
if (!$status) {
|
|
|
|
|
$model->rollback();
|
|
|
|
|
return ['status' => false, 'msg' => '系统异常,修改推广员CHAIN失败'];
|
|
|
|
@ -395,7 +401,7 @@ class PromoteService {
|
|
|
|
|
$promoteId = $params['promote_id'];
|
|
|
|
|
$type = $params['type'];
|
|
|
|
|
|
|
|
|
|
$status = M('ShiftTask')->where(['from_promote_id' => $promoteId, 'type' => $type, 'status' => 0])->save(['status' => 2]);
|
|
|
|
|
$status = M('ShiftTask')->where(['from_promote_id' => $promoteId, 'type' => $type, 'status' => 0])->save(['status' => 2, 'handle_time' => time()]);
|
|
|
|
|
|
|
|
|
|
if ($status) {
|
|
|
|
|
return ['status' => true, 'msg' => '取消成功'];
|
|
|
|
|