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;
|
||
|
}
|
||
|
|
||
|
}
|