|
@@ -12,7 +12,8 @@ class merchant_infoControl extends mbMerchantControl
|
|
|
{
|
|
|
$mchid = $this->mchid();
|
|
|
$model_merchant = Model('merchant');
|
|
|
- $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid], 'mchid,admin_id,name,alarm_amount,ip_white_list,use_key,contact_name,contact_phone,warning_phone,company_name');
|
|
|
+ $field = 'mchid,admin_id,name,alarm_amount,ip_white_list,use_key,contact_name,contact_phone,warning_phone,company_name,quality,time_out';
|
|
|
+ $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid], $field);
|
|
|
$model_member = Model('member');
|
|
|
$member_info = $model_member->getMemberInfo(['member_id' => $merchant_info['admin_id']], 'available_predeposit');
|
|
|
if (empty($member_info)) {
|
|
@@ -40,9 +41,42 @@ class merchant_infoControl extends mbMerchantControl
|
|
|
$cond['add_time'] = ['between', [strtotime(date("Y-m-d",time())), time()]];
|
|
|
$day_evidence = $model_merchant->getRefillEvidence($cond);
|
|
|
$merchant_info['evidence_count'] = count($day_evidence);
|
|
|
+ $merchant_info['time_out'] = intval($merchant_info['time_out'] / 60);
|
|
|
+ $merchant_info['quality'] = intval($merchant_info['quality']);
|
|
|
return self::outsuccess($merchant_info);
|
|
|
}
|
|
|
|
|
|
+ public function SetQualityTimeOutOp()
|
|
|
+ {
|
|
|
+ $mchid = $this->mchid();
|
|
|
+ $save = [];
|
|
|
+ $quality = intval($_POST['quality']);
|
|
|
+ if($quality > 0) {
|
|
|
+ if(!in_array($quality , [1,2,3])) {
|
|
|
+ return self::outerr(errcode::ErrParamter, "通道质量类型错误");
|
|
|
+ }
|
|
|
+ $save['quality'] = $quality;
|
|
|
+ }
|
|
|
+ $time_out = intval($_POST['time_out']);
|
|
|
+ if($quality > 0) {
|
|
|
+ if($time_out <3) {
|
|
|
+ return self::outerr(errcode::ErrParamter, "超时时间应大于3分钟");
|
|
|
+ }
|
|
|
+ $time_out = intval($time_out * 60);
|
|
|
+ $save['time_out'] = $time_out;
|
|
|
+ }
|
|
|
+ if(empty($save)) {
|
|
|
+ return self::outsuccess([]);
|
|
|
+ }
|
|
|
+ $model_merchant = Model('merchant');
|
|
|
+ $resp = $model_merchant->editMerchant($save, ['mchid' => $mchid]);
|
|
|
+ if($resp) {
|
|
|
+ return self::outsuccess([]);
|
|
|
+ }else{
|
|
|
+ return self::outerr(errcode::ErrOperation, "系统错误.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function homeOp()
|
|
|
{
|
|
|
$mchid = $this->mchid();
|