Commit d10a3ead authored by pengfei's avatar pengfei

Merge branch 'colonel' into test

# Conflicts:
#	application/services/user/UserService.php
parents 4cc5fd92 5a660b43
......@@ -33,11 +33,11 @@ class BaseException extends \Exception
$this->msg = $params['msg'] ?? Registry::get('config')->exception->user->msg;
if (isset($params['cus']) && $this->cus && isset($this->cus[intval($params['cus'])]) && $this->base_code) {
return $this->setCusMsg($params['cus']);
return $this->setCusMsg($params['cus'],$params['data']??'');
}
}
public function setCusMsg($cus)
public function setCusMsg($cus,$data = '')
{
//每个服务都有自己的codePrefix
$appid = \Yaf\Application::app()->getConfig()->get("appid");
......@@ -48,7 +48,7 @@ class BaseException extends \Exception
$base_code = intval($this->base_code);
$this->code = $codePrefix + $base_code + $cus_code;
$this->msg = isset($params['data']) ? vsprintf($this->cus[$cus_code],$params['data']) : $this->cus[$cus_code];
$this->msg = !empty($data) ? vsprintf($this->cus[$cus_code],$data) : $this->cus[$cus_code];
}
public function __get($name): bool
......
......@@ -41,7 +41,7 @@ class BaseValidate extends Validate
protected function isMobile($value)
{
$rule = '^1(3|4|5|7|8)[0-9]\d{8}$^';
$rule = '^1(3|4|5|6|7|8|9)[0-9]\d{8}$^';
$result = preg_match($rule, $value);
if ($result) {
return true;
......
......@@ -234,7 +234,7 @@ class ColonelorderController extends Job
$res = Idgen::get(appConfig('idgen.partner'), appConfig('idgen.key'), [], $httpParams);
$ids = $res['id_datetime']['goods'] ?? [];
if ($count > count($ids)) {
throw new Exception('请求idgen服务失败,' . ['req' => $httpParams,'res' => $res]);
throw new Exception('请求idgen服务失败,' . ['req' => $httpParams, 'res' => $res]);
}
foreach ($data as $key => $item) {
$data[$key]['pay_info_trade_id'] = $ids[$key];
......@@ -288,7 +288,7 @@ class ColonelorderController extends Job
$response = HttpUtil::post($url, $httpParams, 100000, 3);
$this->loggerInfo("url=$url,request=" . json_encode($httpParams) . ";response=" . json_encode($response));
if (!isset($response['response']['result']['capital_pool_total'])) {
throw new Exception('没有获取到资金池信息');
throw new Exception('没有获取到资金池信息,' . ['req' => $httpParams, 'res' => $response]);
}
$result = $response['response']['result'];
$balance = ($result['capital_pool_total'] - $result['capital_pool_lock'] - $result['capital_pool_used']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment