|
@@ -35,10 +35,10 @@ class JuliangAccountController extends CatchController
|
|
'account_name' => 'required|string|max:64',
|
|
'account_name' => 'required|string|max:64',
|
|
'callback_state' => 'required|integer|in:0,1',
|
|
'callback_state' => 'required|integer|in:0,1',
|
|
'protect_num' => 'required|integer|min:0',
|
|
'protect_num' => 'required|integer|min:0',
|
|
- 'callback_default_rate' => 'required|min:0|max:100',
|
|
|
|
- 'callback_rate_time_config' => 'nullable|array',
|
|
|
|
- 'callback_min_money' => 'required|min:0',
|
|
|
|
- 'callback_max_money' => 'required|min:0'
|
|
|
|
|
|
+ 'default_rate' => 'required|min:0|max:100',
|
|
|
|
+ 'rate_time_config' => 'nullable|array',
|
|
|
|
+ 'min_money' => 'required|min:0',
|
|
|
|
+ 'max_money' => 'required|min:0'
|
|
]);
|
|
]);
|
|
|
|
|
|
if(DB::table('juliang_account_callback_config')
|
|
if(DB::table('juliang_account_callback_config')
|
|
@@ -46,8 +46,8 @@ class JuliangAccountController extends CatchController
|
|
->exists()) {
|
|
->exists()) {
|
|
CommonBusinessException::throwError(Errors::JULIANG_ACCOUNT_EXISTS);
|
|
CommonBusinessException::throwError(Errors::JULIANG_ACCOUNT_EXISTS);
|
|
}
|
|
}
|
|
- if($request->input('callback_rate_time_config') &&
|
|
|
|
- !$this->is_time_cross($request->input('callback_rate_time_config'))) {
|
|
|
|
|
|
+ if($request->input('rate_time_config') &&
|
|
|
|
+ !$this->is_time_cross($request->input('rate_time_config'))) {
|
|
CommonBusinessException::throwError(Errors::CALLBACK_RATE_TIME_RANGE_ERROR);
|
|
CommonBusinessException::throwError(Errors::CALLBACK_RATE_TIME_RANGE_ERROR);
|
|
}
|
|
}
|
|
$now = date('Y-m-d H:i:s');
|
|
$now = date('Y-m-d H:i:s');
|
|
@@ -55,12 +55,12 @@ class JuliangAccountController extends CatchController
|
|
->insert([
|
|
->insert([
|
|
'adv_account_id' => $request->input('account_id'),
|
|
'adv_account_id' => $request->input('account_id'),
|
|
'adv_account_name' => $request->input('account_name'),
|
|
'adv_account_name' => $request->input('account_name'),
|
|
- 'callback_state' => $request->input('callback_state'),
|
|
|
|
|
|
+ 'state' => $request->input('state'),
|
|
'protect_num' => $request->input('protect_num'),
|
|
'protect_num' => $request->input('protect_num'),
|
|
- 'callback_default_rate' => $request->input('callback_default_rate'),
|
|
|
|
- 'callback_rate_time_config' => \json_encode($request->input('callback_rate_time_config', [])),
|
|
|
|
- 'callback_min_money' => $request->input('callback_min_money'),
|
|
|
|
- 'callback_max_money' => $request->input('callback_max_money'),
|
|
|
|
|
|
+ 'default_rate' => $request->input('default_rate'),
|
|
|
|
+ 'rate_time_config' => \json_encode($request->input('rate_time_config', [])),
|
|
|
|
+ 'min_money' => $request->input('min_money'),
|
|
|
|
+ 'max_money' => $request->input('max_money'),
|
|
'company_uid' => $this->getCompanyUid(),
|
|
'company_uid' => $this->getCompanyUid(),
|
|
'created_at' => $now,
|
|
'created_at' => $now,
|
|
'updated_at' => $now,
|
|
'updated_at' => $now,
|
|
@@ -69,11 +69,11 @@ class JuliangAccountController extends CatchController
|
|
->insert([
|
|
->insert([
|
|
'company_uid' => $this->getCompanyUid(),
|
|
'company_uid' => $this->getCompanyUid(),
|
|
'account_id' => $request->input('account_id'),
|
|
'account_id' => $request->input('account_id'),
|
|
- 'config_per' => $request->input('callback_default_rate'),
|
|
|
|
|
|
+ 'config_per' => $request->input('default_rate'),
|
|
'created_at' => $now,
|
|
'created_at' => $now,
|
|
'updated_at' => $now,
|
|
'updated_at' => $now,
|
|
]);
|
|
]);
|
|
- if($request->input('callback_rate_time_config')) {
|
|
|
|
|
|
+ if($request->input('rate_time_config')) {
|
|
$this->saveTimeConfig($this->getCompanyUid(), $request->input('account_id'), $request);
|
|
$this->saveTimeConfig($this->getCompanyUid(), $request->input('account_id'), $request);
|
|
}
|
|
}
|
|
return 'ok';
|
|
return 'ok';
|
|
@@ -82,15 +82,15 @@ class JuliangAccountController extends CatchController
|
|
public function updateCallbackConfig(Request $request) {
|
|
public function updateCallbackConfig(Request $request) {
|
|
$this->validate($request, [
|
|
$this->validate($request, [
|
|
'ids' => 'required|array',
|
|
'ids' => 'required|array',
|
|
- 'callback_state' => 'required|integer|in:0,1',
|
|
|
|
|
|
+ 'state' => 'required|integer|in:0,1',
|
|
'protect_num' => 'required|integer|min:0',
|
|
'protect_num' => 'required|integer|min:0',
|
|
- 'callback_default_rate' => 'required|min:0|max:100',
|
|
|
|
- 'callback_rate_time_config' => 'nullable|array',
|
|
|
|
- 'callback_min_money' => 'required|min:0',
|
|
|
|
- 'callback_max_money' => 'required|min:0'
|
|
|
|
|
|
+ 'default_rate' => 'required|min:0|max:100',
|
|
|
|
+ 'rate_time_config' => 'nullable|array',
|
|
|
|
+ 'min_money' => 'required|min:0',
|
|
|
|
+ 'max_money' => 'required|min:0'
|
|
]);
|
|
]);
|
|
if($request->input('callback_rate_time_config') &&
|
|
if($request->input('callback_rate_time_config') &&
|
|
- !$this->is_time_cross($request->input('callback_rate_time_config'))) {
|
|
|
|
|
|
+ !$this->is_time_cross($request->input('rate_time_config'))) {
|
|
CommonBusinessException::throwError(Errors::CALLBACK_RATE_TIME_RANGE_ERROR);
|
|
CommonBusinessException::throwError(Errors::CALLBACK_RATE_TIME_RANGE_ERROR);
|
|
}
|
|
}
|
|
$now = date('Y-m-d H:i:s');
|
|
$now = date('Y-m-d H:i:s');
|
|
@@ -98,12 +98,12 @@ class JuliangAccountController extends CatchController
|
|
DB::table('juliang_account_callback_config')
|
|
DB::table('juliang_account_callback_config')
|
|
->where(['id' => $id, 'company_uid' => $this->getCompanyUid()])
|
|
->where(['id' => $id, 'company_uid' => $this->getCompanyUid()])
|
|
->update([
|
|
->update([
|
|
- 'callback_state' => $request->input('callback_state'),
|
|
|
|
|
|
+ 'state' => $request->input('state'),
|
|
'protect_num' => $request->input('protect_num'),
|
|
'protect_num' => $request->input('protect_num'),
|
|
- 'callback_default_rate' => $request->input('callback_default_rate'),
|
|
|
|
- 'callback_rate_time_config' => \json_encode($request->input('callback_rate_time_config', [])),
|
|
|
|
- 'callback_min_money' => $request->input('callback_min_money'),
|
|
|
|
- 'callback_max_money' => $request->input('callback_max_money'),
|
|
|
|
|
|
+ 'default_rate' => $request->input('default_rate'),
|
|
|
|
+ 'rate_time_config' => \json_encode($request->input('rate_time_config', [])),
|
|
|
|
+ 'min_money' => $request->input('min_money'),
|
|
|
|
+ 'max_money' => $request->input('max_money'),
|
|
'updated_at' => $now,
|
|
'updated_at' => $now,
|
|
]);
|
|
]);
|
|
}
|
|
}
|
|
@@ -122,7 +122,7 @@ class JuliangAccountController extends CatchController
|
|
->insert([
|
|
->insert([
|
|
'company_uid' => $this->getCompanyUid(),
|
|
'company_uid' => $this->getCompanyUid(),
|
|
'account_id' => $accountId,
|
|
'account_id' => $accountId,
|
|
- 'config_per' => $request->input('callback_default_rate'),
|
|
|
|
|
|
+ 'config_per' => $request->input('default_rate'),
|
|
'created_at' => $now,
|
|
'created_at' => $now,
|
|
'updated_at' => $now,
|
|
'updated_at' => $now,
|
|
]);
|
|
]);
|
|
@@ -175,7 +175,7 @@ class JuliangAccountController extends CatchController
|
|
->where('is_enable',1)
|
|
->where('is_enable',1)
|
|
->where('company_uid',$companyUid)
|
|
->where('company_uid',$companyUid)
|
|
->where('account_id',$accountId)->update(['is_enable'=>0]);
|
|
->where('account_id',$accountId)->update(['is_enable'=>0]);
|
|
- $time_config = $configInfo['callback_rate_time_config'];
|
|
|
|
|
|
+ $time_config = $configInfo['rate_time_config'];
|
|
if (empty($time_config)) {
|
|
if (empty($time_config)) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -187,11 +187,11 @@ class JuliangAccountController extends CatchController
|
|
$temp['company_uid'] = $companyUid;
|
|
$temp['company_uid'] = $companyUid;
|
|
|
|
|
|
$temp['account_id'] = $accountId;
|
|
$temp['account_id'] = $accountId;
|
|
- $temp['other_data']['callback_default_rate'] = $configInfo['callback_default_rate'];
|
|
|
|
- $temp['other_data']['callback_min_money'] = $configInfo['callback_min_money'];
|
|
|
|
- $temp['other_data']['callback_max_money'] = $configInfo['callback_max_money'];
|
|
|
|
|
|
+ $temp['other_data']['default_rate'] = $configInfo['default_rate'];
|
|
|
|
+ $temp['other_data']['min_money'] = $configInfo['min_money'];
|
|
|
|
+ $temp['other_data']['max_money'] = $configInfo['max_money'];
|
|
$temp['other_data']['protect_num'] = $configInfo['protect_num'];
|
|
$temp['other_data']['protect_num'] = $configInfo['protect_num'];
|
|
- $temp['other_data']['callback_state'] = $configInfo['callback_state'];
|
|
|
|
|
|
+ $temp['other_data']['state'] = $configInfo['state'];
|
|
$temp['other_data'] = json_encode($temp['other_data']);
|
|
$temp['other_data'] = json_encode($temp['other_data']);
|
|
$temp['next_exec_time'] = date('Y-m-d');
|
|
$temp['next_exec_time'] = date('Y-m-d');
|
|
|
|
|
|
@@ -206,7 +206,7 @@ class JuliangAccountController extends CatchController
|
|
$data[] = $temp;
|
|
$data[] = $temp;
|
|
//结束后 百分比改为默认的
|
|
//结束后 百分比改为默认的
|
|
$temp['config_time'] = $end_time;
|
|
$temp['config_time'] = $end_time;
|
|
- $temp['config_per'] = $configInfo['callback_default_rate'];
|
|
|
|
|
|
+ $temp['config_per'] = $configInfo['default_rate'];
|
|
$data[] = $temp;
|
|
$data[] = $temp;
|
|
}
|
|
}
|
|
//插入设置最新的时间段百分比
|
|
//插入设置最新的时间段百分比
|