
- 新增码速达配置选项,包括订单备注状态和售后处理状态- 实现限购数量和金额的 redis 优化处理 - 添加渠道余额获取功能 - 修改订单状态更新逻辑,支持码速达- 优化自动发卡软件设置界面
86 lines
1.7 KiB
PHP
86 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace app\private_api\controller\monitorApi;
|
|
|
|
use app\channel\service\ChannelService;
|
|
use app\merchant\service\MerchantService;
|
|
|
|
/**
|
|
* 接口处理
|
|
* Class Handle
|
|
* @package app\gateway\api
|
|
*/
|
|
class Channel extends Core
|
|
{
|
|
# 是否检测数据
|
|
protected bool $check = false;
|
|
|
|
#获取渠道余额
|
|
public function AllBalance()
|
|
{
|
|
$data = ChannelService::instance()->getAll();
|
|
|
|
$where['is_deleted'] = 0;
|
|
$where['status'] = 1;
|
|
$data = MerchantService::instance()->db()->field('name,account_surplus,credit_surplus,appid')->where($where)->select()->toArray();
|
|
$this->yes($data);
|
|
|
|
}
|
|
|
|
protected function maketime($v): float|false|int|string
|
|
{
|
|
if (!$v) {
|
|
return '';
|
|
}
|
|
|
|
if (is_numeric($v)) {
|
|
return $v;
|
|
}
|
|
|
|
if (is_array($v)) {
|
|
$v = $v[1];
|
|
}
|
|
|
|
if (strstr($v, ' ')) {
|
|
$t = explode(' ', $v);
|
|
$v = $t[0];
|
|
$s = explode(':', $t[1]);
|
|
} else {
|
|
$s = array(0, 0, 0);
|
|
}
|
|
|
|
if (!isset($s[1])) {
|
|
$s[1] = 0;
|
|
}
|
|
|
|
if (!isset($s[2])) {
|
|
$s[2] = 0;
|
|
}
|
|
|
|
if (strstr($v, '-')) {
|
|
$t = explode('-', $v);
|
|
} elseif (strstr($v, '/')) {
|
|
$u = explode('/', $v);
|
|
$t[0] = $u[2];
|
|
$t[1] = $u[0];
|
|
$t[2] = $u[1];
|
|
}
|
|
|
|
if (!isset($t)) {
|
|
$t = array(0, 0, 0);
|
|
}
|
|
|
|
if (!isset($t[1])) {
|
|
$t[1] = 0;
|
|
}
|
|
|
|
if (!isset($t[2])) {
|
|
$t[2] = 0;
|
|
}
|
|
|
|
$v = mktime($s[0], $s[1], $s[2], $t[1], $t[2], $t[0]);
|
|
|
|
return $v;
|
|
}
|
|
|
|
} |