app/controller/admfor035/acc.php
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace WY\app\controller\admfor035;
use WY\app\libs\Controller;
if (!defined('WY_ROOT')) {
exit;
}
class acc extends CheckAdmin
{
public function index()
{
$acp = $this->model()->select()->from('acp')->fetchAll();
$lists = $this->model()->select()->from('acc')->orderby('sortid asc,id desc')->fetchAll();
$data = array('title' => '通道列表', 'lists' => $lists, 'acp' => $acp);
$this->put('acc.php', $data);
}
public function save()
{
$data = isset($_POST) ? $_POST : false;
if ($data) {
$acwid = $this->model()->select('acwid')->from('acl')->where(array('fields' => 'gateway=? and acpcode=?', 'values' => array($data['gateway'], $data['acpcode'])))->fetchRow();
$data += $acwid;
if ($this->model()->from('acc')->where(array('fields' => 'acwid=? and is_display=?', 'values' => array($acwid['acwid'], 0)))->count()) {
$data['is_display'] = 1;
}
$acw = $this->model()->select('price')->from('acw')->where(array('fields' => 'id=?', 'values' => array($acwid['acwid'])))->fetchRow();
if ($acw && $acw['price']) {
$data += array('is_card' => 1);
}
if ($accid = $this->model()->from('acc')->insertData($data)->insert()) {
if ($data['is_display'] == 0) {
$users = $this->model()->select('id')->from('users')->fetchAll();
if ($users) {
foreach ($users as $key => $val) {
$insertData = array('userid' => $val['id'], 'channelid' => $accid, 'uprice' => $this->req->post('uprice'), 'gprice' => $this->req->post('gprice'), 'is_state' => $this->req->post('is_state'));
$this->model()->from('userprice')->insertData($insertData)->insert();
}
}
}
echo json_encode(array('status' => 1, 'msg' => '设置保存成功', 'url' => $this->dir . 'acc'));
exit;
}
}
echo json_encode(array('status' => 0, 'msg' => '设置保存失败'));
exit;
}
public function edit()
{
$id = isset($this->action[3]) ? intval($this->action[3]) : 0;
$acp = $this->model()->select()->from('acp')->fetchAll();
$acc = $this->model()->select()->from('acc')->where(array('fields' => 'id=?', 'values' => array($id)))->fetchRow();
$acl = $this->model()->select('a.gateway,b.name')->left('acw b')->on('a.acwid=b.id')->join()->from('acl a')->where(array('fields' => 'a.acpcode=?', 'values' => array($acc['acpcode'])))->fetchAll();
$data = array('title' => '编辑通道', 'data' => $acc, 'acp' => $acp, 'acl' => $acl);
$this->put('accedit.php', $data);
}
public function editsave()
{
$id = isset($this->action[3]) ? intval($this->action[3]) : 0;
$data = isset($_POST) ? $_POST : false;
$is_check = $this->req->post('is_check');
后面还有 80 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
