推广结算管理日志添加

master
zhengyongxing 5 years ago
parent ab6e063c9a
commit 665b4c8bfa

@ -336,6 +336,7 @@ class QueryController extends ThinkController
$promoteId = intval(I('promote_id', 0)); $promoteId = intval(I('promote_id', 0));
$settlementType = intval(I('settlement_type', 0)); $settlementType = intval(I('settlement_type', 0));
$time = I('time', ''); $time = I('time', '');
if (empty($promoteId)) { if (empty($promoteId)) {
$data['status'] = 0; $data['status'] = 0;
$data['msg'] = '请选择会长账号'; $data['msg'] = '请选择会长账号';
@ -363,11 +364,11 @@ class QueryController extends ThinkController
$data['msg'] = '非会长账号,无法执行此操作'; $data['msg'] = '非会长账号,无法执行此操作';
$this->ajaxReturn($data); $this->ajaxReturn($data);
} }
if ($promote['ver_status'] != 1) { // if ($promote['ver_status'] != 1) {
$data['status'] = 0; // $data['status'] = 0;
$data['msg'] = '该会长未通过资质认证审核,暂时无法提现'; // $data['msg'] = '该会长未通过资质认证审核,暂时无法提现';
$this->ajaxReturn($data); // $this->ajaxReturn($data);
} // }
if ($promote['settlement_type'] == 1) { if ($promote['settlement_type'] == 1) {
if (!in_array($settlementType, [1, 3])) { if (!in_array($settlementType, [1, 3])) {
$data['status'] = 0; $data['status'] = 0;
@ -404,6 +405,7 @@ class QueryController extends ThinkController
switch ($settlementType) { switch ($settlementType) {
case 1: case 1:
$result = $withdrawModel->promoteWithdrawWeeklyByPromote($promote, false, $data); $result = $withdrawModel->promoteWithdrawWeeklyByPromote($promote, false, $data);
break; break;
case 2: case 2:
$result = $withdrawModel->promoteWithdrawPerMonthByPromote($promote, false, $data); $result = $withdrawModel->promoteWithdrawPerMonthByPromote($promote, false, $data);

@ -184,6 +184,10 @@ class WithdrawModel extends Model{
->find()['balance']; ->find()['balance'];
$balance = $balance ?? 0; $balance = $balance ?? 0;
$balance = bcdiv($balance, 100, 2); $balance = bcdiv($balance, 100, 2);
// addOperationLog(['op_type'=>1,'key'=>$promote['account'].$data['begin_time'].$data['end_time'].$balance,'op_name'=>'推广结算提现','url'=>U('Query/settlement'),'menu'=>'推广员-结算管理-推广结算-推广结算提现']);
if ($balance < 100) { if ($balance < 100) {
return -2;//余额不足 return -2;//余额不足
} }
@ -237,6 +241,8 @@ class WithdrawModel extends Model{
return -1; return -1;
} }
addOperationLog(['op_type'=>1,'key'=>$promote['account'].$data['begin_time'].$data['end_time'].$balance,'op_name'=>'推广结算提现','url'=>U('Query/settlement'),'menu'=>'推广员-结算管理-推广结算-推广结算提现']);
M()->commit();//事物提交 M()->commit();//事物提交
return 1; return 1;
} }

Loading…
Cancel
Save