推广员业务配置功能添加

master
zhengyongxing 5 years ago
parent 295ca2d803
commit a5554f7fa3

@ -487,43 +487,44 @@ class PromoteCompanyController extends ThinkController
$promoteData = implode(',',array_column($promoteData,'id'));
if ($changeData['admin_type']) {
if ($changeData['admin_type'] == 1) {
$num_pend = 0;
$num_deposit = 0;
if ($promoteData) {
$sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in ({$promoteData})";
$sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in ({$promoteData})";
$sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in({$promoteData})";
$sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='{$changeData['admin_type']}' WHERE promote_id in({$promoteData})";
$model = new \Think\Model();
$num_pend = $model->execute($sql_spend,true);
// $num_deposit = $model->execute($sql_deposit,true);
$num_deposit = $model->execute($sql_deposit,true);
$this->ajaxReturn(['info'=>"将数据设为'{$changeData['admin_type']}',处理订单数据".($num_pend+$num_deposit).'条']);
$this->ajaxReturn(['info'=>"处理订单数据".($num_pend+$num_deposit).'条']);
}
} else if ($changeData['admin_type'] == 2){
$num_pend = 0;
$num_deposit = 0;
if ($promoteData) {
$sql_spend = "UPDATE `tab_spend` SET `promote_id`=`old_change_promote_id`,`promote_account`=`old_change_promote_account`,`old_change_promote_id`=0,`old_change_promote_account`=''
WHERE old_change_promote_id in ({$promoteData})";
$sql_deposit = "UPDATE `tab_deposit` SET `promote_id`=`old_change_promote_id`,`promote_account`=`old_change_promote_account`,`old_change_promote_id`=0,`old_change_promote_account`=''
WHERE old_change_promote_id in ({$promoteData})";
$model = new \Think\Model();
$num_pend = $model->execute($sql_spend,true);
$num_deposit = $model->execute($sql_deposit,true);
$this->ajaxReturn(['info'=>"将数据还原,处理订单数据".($num_pend+$num_deposit).'条']);
}
}
// else {
// $num_pend = 0;
// $num_deposit = 0;
//
// if ($promoteData) {
//
// $sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='无' WHERE promote_id in ({$promoteData})";
// $sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='无' WHERE promote_id in ({$promoteData})";
//
// $model = new \Think\Model();
// $num_pend = $model->execute($sql_spend,true);
// $num_deposit = $model->execute($sql_deposit,true);
//
// $this->ajaxReturn(['info'=>"将数据还原,处理数据".($num_pend+$num_deposit).'条']);
//
// }
//
// }
} else {

@ -52,19 +52,19 @@
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="admin_type" name="admin_type" class="select_gallery" style="width: 215px;">
<option value=""></option>
<option value="市场专员">市场专员</option>
<option value="1"></option>
<option value="2">市场专员</option>
</select>
</div>
</td>
</tr>
<tr style="display: none">
<tr>
<td class="l">聚合平台订单归属:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="together_type" name="together_type" class="select_gallery" style="width: 215px;">
<option value=""></option>
<option value="市场专员">市场专员</option>
<option value="1"></option>
<option value="2">市场专员</option>
</select>
</div>
</td>

Loading…
Cancel
Save