app/controller/admfor035/acw.php
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace WY\app\controller\admfor035;
use WY\app\libs\Controller;
if (!defined('WY_ROOT')) {
exit;
}
class acw extends CheckAdmin
{
public function index()
{
$data = array('title' => '通用网关');
$lists = $this->model()->select()->from('acw')->orderby('id asc')->fetchAll();
$data += array('lists' => $lists);
$this->put('acw.php', $data);
}
public function save()
{
$name = $this->req->post('name');
$code = $this->req->post('code');
$price = $this->req->post('price');
$length = $this->req->post('length');
$img = $this->req->post('img');
if ($name == '' || $code == '') {
echo json_encode(array('status' => 0, 'msg' => '选项填写不完整'));
exit;
}
$data = array('name' => $name, 'code' => $code, 'price' => $price ? json_encode(explode('|', $price)) : '', 'length' => $length ? json_encode(explode('|', $length)) : '', 'img' => $img);
if ($this->model()->from('acw')->insertData($data)->insert()) {
echo json_encode(array('status' => 1, 'msg' => '设置保存成功', 'url' => $this->dir . 'acw'));
exit;
}
echo json_encode(array('status' => 0, 'msg' => '设置保存失败'));
exit;
}
public function edit()
{
$id = isset($this->action[3]) ? intval($this->action[3]) : 0;
$data = array('title' => '编辑通用网关');
$acw = $this->model()->select()->from('acw')->where(array('fields' => 'id=?', 'values' => array($id)))->fetchRow();
$data += array('data' => $acw);
$this->put('acwedit.php', $data);
}
public function editsave()
{
$id = isset($this->action[3]) ? intval($this->action[3]) : 0;
$name = $this->req->post('name');
$code = $this->req->post('code');
$price = $this->req->post('price');
$length = $this->req->post('length');
$img = $this->req->post('img');
if ($name == '' || $code == '') {
echo json_encode(array('status' => 0, 'msg' => '选项填写不完整'));
exit;
}
$data = array('name' => $name, 'code' => $code, 'price' => $price ? json_encode(explode('|', $price)) : '', 'length' => $length ? json_encode(explode('|', $length)) : '', 'img' => $img);
if ($this->model()->from('acw')->updateSet($data)->where(array('fields' => 'id=?', 'values' => array($id)))->update()) {
echo json_encode(array('status' => 1, 'msg' => '设置保存成功', 'url' => $this->dir . 'acw'));
exit;
}
后面还有 16 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
