|
|
@ -127,6 +127,16 @@ class PaymentMerchantController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$statusText = $status == 0 ? '禁用' : '启用';
|
|
|
|
$statusText = $status == 0 ? '禁用' : '启用';
|
|
|
|
M('payment_merchant', 'tab_')->where(['id' => $id])->save(['status' => $status]);
|
|
|
|
M('payment_merchant', 'tab_')->where(['id' => $id])->save(['status' => $status]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addOperationLog([
|
|
|
|
|
|
|
|
'op_type' => 1,
|
|
|
|
|
|
|
|
'key' => $id,
|
|
|
|
|
|
|
|
'op_name' => '修改商户状态',
|
|
|
|
|
|
|
|
'url' => U('PaymentMerchant/changeStatus'),
|
|
|
|
|
|
|
|
'menu' => '系统-扩展工具-支付收款商户-修改商户状态',
|
|
|
|
|
|
|
|
'content' => json_encode(['status' => $status]),
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
$this->ajaxReturn([
|
|
|
|
'status' => 1,
|
|
|
|
'status' => 1,
|
|
|
|
'message' => $statusText . '成功',
|
|
|
|
'message' => $statusText . '成功',
|
|
|
@ -212,9 +222,28 @@ class PaymentMerchantController extends ThinkController
|
|
|
|
$data['channel'] = $channel;
|
|
|
|
$data['channel'] = $channel;
|
|
|
|
$data['identifier'] = $paymentMerchantService->getIdentifierByConfig($config, $channel);
|
|
|
|
$data['identifier'] = $paymentMerchantService->getIdentifierByConfig($config, $channel);
|
|
|
|
M('payment_merchant', 'tab_')->add($data);
|
|
|
|
M('payment_merchant', 'tab_')->add($data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addOperationLog([
|
|
|
|
|
|
|
|
'op_type' => 0,
|
|
|
|
|
|
|
|
'key' => $id,
|
|
|
|
|
|
|
|
'op_name' => '添加商户',
|
|
|
|
|
|
|
|
'url' => U('PaymentMerchant/save'),
|
|
|
|
|
|
|
|
'menu' => '系统-扩展工具-支付收款商户-添加商户',
|
|
|
|
|
|
|
|
'content' => json_encode($data),
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$data['identifier'] = $paymentMerchantService->getIdentifierByConfig($config, $merchant['channel']);
|
|
|
|
$data['identifier'] = $paymentMerchantService->getIdentifierByConfig($config, $merchant['channel']);
|
|
|
|
M('payment_merchant', 'tab_')->where(['id' => $id])->save($data);
|
|
|
|
M('payment_merchant', 'tab_')->where(['id' => $id])->save($data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addOperationLog([
|
|
|
|
|
|
|
|
'op_type' => 1,
|
|
|
|
|
|
|
|
'key' => $id,
|
|
|
|
|
|
|
|
'op_name' => '修改商户',
|
|
|
|
|
|
|
|
'url' => U('PaymentMerchant/save'),
|
|
|
|
|
|
|
|
'menu' => '系统-扩展工具-支付收款商户-修改商户',
|
|
|
|
|
|
|
|
'content' => json_encode($data),
|
|
|
|
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
$this->ajaxReturn([
|
|
|
@ -228,14 +257,23 @@ class PaymentMerchantController extends ThinkController
|
|
|
|
public function delete()
|
|
|
|
public function delete()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$id = I('id', 0);
|
|
|
|
$id = I('id', 0);
|
|
|
|
M('payment_merchant', 'tab_')->where(['id' => $id])->delete();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$merchant = M('payment_merchant', 'tab_')->where(['id' => $id])->find();
|
|
|
|
|
|
|
|
if ($merchant === null) {
|
|
|
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
|
|
|
|
'status' => 0,
|
|
|
|
|
|
|
|
'message' => '记录不存在'
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
M('payment_merchant', 'tab_')->where(['id' => $id])->delete();
|
|
|
|
addOperationLog([
|
|
|
|
addOperationLog([
|
|
|
|
'op_type' => 2,
|
|
|
|
'op_type' => 2,
|
|
|
|
'key' => $id,
|
|
|
|
'key' => $id,
|
|
|
|
'op_name' => '删除商户渠道',
|
|
|
|
'op_name' => '删除商户',
|
|
|
|
'url' => U('Market/delete', ['id' => $id]),
|
|
|
|
'url' => U('PaymentMerchant/delete'),
|
|
|
|
'menu' => '推广员-推广员管理-市场换绑-删除商户渠道'
|
|
|
|
'menu' => '系统-扩展工具-支付收款商户-删除商户',
|
|
|
|
|
|
|
|
'content' => json_encode($merchant),
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
$this->ajaxReturn([
|
|
|
@ -284,6 +322,15 @@ class PaymentMerchantController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$model->commit();
|
|
|
|
$model->commit();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addOperationLog([
|
|
|
|
|
|
|
|
'op_type' => 1,
|
|
|
|
|
|
|
|
'key' => implode(',', array_values($setting)),
|
|
|
|
|
|
|
|
'op_name' => '设置默认商户',
|
|
|
|
|
|
|
|
'url' => U('PaymentMerchant/saveDefault'),
|
|
|
|
|
|
|
|
'menu' => '系统-扩展工具-支付收款商户-设置默认商户',
|
|
|
|
|
|
|
|
'content' => json_encode($setting),
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
$this->ajaxReturn([
|
|
|
|
'status' => 1,
|
|
|
|
'status' => 1,
|
|
|
|
'message' => '设置成功'
|
|
|
|
'message' => '设置成功'
|
|
|
@ -462,6 +509,7 @@ class PaymentMerchantController extends ThinkController
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ids = [];
|
|
|
|
$paymentRuleService = new PaymentRuleService();
|
|
|
|
$paymentRuleService = new PaymentRuleService();
|
|
|
|
foreach ($records as $record) {
|
|
|
|
foreach ($records as $record) {
|
|
|
|
$startTime = $record['start_time'] == '' ? 0 : strtotime($record['start_time'] . ' 00:00:00');
|
|
|
|
$startTime = $record['start_time'] == '' ? 0 : strtotime($record['start_time'] . ' 00:00:00');
|
|
|
@ -486,8 +534,18 @@ class PaymentMerchantController extends ThinkController
|
|
|
|
'update_time' => time()
|
|
|
|
'update_time' => time()
|
|
|
|
];
|
|
|
|
];
|
|
|
|
$id = M('payment_rule', 'tab_')->add($item);
|
|
|
|
$id = M('payment_rule', 'tab_')->add($item);
|
|
|
|
|
|
|
|
$ids[] = $id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addOperationLog([
|
|
|
|
|
|
|
|
'op_type' => 0,
|
|
|
|
|
|
|
|
'key' => implode(',', $ids),
|
|
|
|
|
|
|
|
'op_name' => '新增支付商户配置',
|
|
|
|
|
|
|
|
'url' => U('PaymentMerchant/saveRule'),
|
|
|
|
|
|
|
|
'menu' => '推广员-推广员管理-支付商户配置-新增支付商户配置',
|
|
|
|
|
|
|
|
'content' => json_encode($records)
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
$this->ajaxReturn([
|
|
|
|
'status' => 1,
|
|
|
|
'status' => 1,
|
|
|
|
'message' => '添加成功'
|
|
|
|
'message' => '添加成功'
|
|
|
@ -587,6 +645,15 @@ class PaymentMerchantController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
M('payment_rule', 'tab_')->where(['id' => $id])->save($item);
|
|
|
|
M('payment_rule', 'tab_')->where(['id' => $id])->save($item);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addOperationLog([
|
|
|
|
|
|
|
|
'op_type' => 1,
|
|
|
|
|
|
|
|
'key' => $id,
|
|
|
|
|
|
|
|
'op_name' => '修改支付商户配置',
|
|
|
|
|
|
|
|
'url' => U('PaymentMerchant/modifyRule', ['id' => $id]),
|
|
|
|
|
|
|
|
'menu' => '推广员-推广员管理-支付商户配置-修改支付商户配置',
|
|
|
|
|
|
|
|
'content' => json_encode(['rule' => $rule, 'modify' => $item]),
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
$this->ajaxReturn([
|
|
|
|
'status' => 1,
|
|
|
|
'status' => 1,
|
|
|
|
'message' => '修改成功'
|
|
|
|
'message' => '修改成功'
|
|
|
@ -596,16 +663,24 @@ class PaymentMerchantController extends ThinkController
|
|
|
|
public function deleteRule()
|
|
|
|
public function deleteRule()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$id = I('id', 0);
|
|
|
|
$id = I('id', 0);
|
|
|
|
M('payment_rule', 'tab_')->where(['id' => $id])->delete();
|
|
|
|
$rule = M('payment_rule', 'tab_')->where(['id' => $id])->find();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$rule) {
|
|
|
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
|
|
|
|
'status' => 0,
|
|
|
|
|
|
|
|
'message' => '记录不存在'
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
M('payment_rule', 'tab_')->where(['id' => $id])->delete();
|
|
|
|
addOperationLog([
|
|
|
|
addOperationLog([
|
|
|
|
'op_type' => 2,
|
|
|
|
'op_type' => 2,
|
|
|
|
'key' => $id,
|
|
|
|
'key' => $id,
|
|
|
|
'op_name' => '删除支付商户配置',
|
|
|
|
'op_name' => '删除支付商户配置',
|
|
|
|
'url' => U('PaymentMerchant/deleteRule', ['id' => $id]),
|
|
|
|
'url' => U('PaymentMerchant/deleteRule', ['id' => $id]),
|
|
|
|
'menu' => '推广员-推广员管理-市场换绑-删除支付商户配置'
|
|
|
|
'menu' => '推广员-推广员管理-支付商户配置-删除支付商户配置',
|
|
|
|
|
|
|
|
'content' => json_encode($rule),
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
$this->ajaxReturn([
|
|
|
|
'status' => 1,
|
|
|
|
'status' => 1,
|
|
|
|
'message' => '删除成功'
|
|
|
|
'message' => '删除成功'
|
|
|
|