From 01e1c68190cccad16257dbf2823270246c6bd445 Mon Sep 17 00:00:00 2001 From: pengda <10266652509@qq.com> Date: Thu, 19 Sep 2024 16:57:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=95=E6=96=B9=E5=90=8E=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/index.php | 17 +++++-- view/templates/index/formula_add.html | 58 +++++++++-------------- view/templates/index/home.html | 88 ++++++++++++++++++++++------------- view/templates/index/login.html | 84 +++++++++++++++++++++++++++++++++ 4 files changed, 175 insertions(+), 72 deletions(-) create mode 100644 view/templates/index/login.html diff --git a/control/index.php b/control/index.php index f4a50aa..c752112 100644 --- a/control/index.php +++ b/control/index.php @@ -10,7 +10,6 @@ include_once(SERVER_ROOT . "/model/mPage.php"); class index extends publicBase { private function _check_login() { -// return array('uid'=>$this->post('uid')); $uid = $this->post('uid'); $token = $this->post('token'); if ($uid < 0 || !$token) $this->ajax_json(false, '参数错误', array('code' => CODE_LOGIN_EXIPRE)); @@ -48,19 +47,29 @@ class index extends publicBase { $user_info = json_decode($user_info, true); if (empty($user_info)) header('Location: /index/login'); + $this->view['uid'] = $user_info['uid']; + $this->view['token'] = $user_info['token']; + $is_all = $this->get('is_all') + 0; $name = trim($this->get('name')); $condition = array(); - if ($name) $condition['name'] = $name; - if (!$is_all) $condition['uid'] = 0; + $url = "/index/home"; + if ($name) { + $condition['name'] = $name; + $url .= "/name/{$name}"; + } + if (!$is_all) { + $condition['uid'] = 0; + $url .= "/is_all/{$is_all}"; + } $total = $mformula->getFormulaTotal($condition); // 分页 $page = new Page(); $page->setTotalnum($total); - $page->setUrl('/index/home/page/'); + $page->setUrl($url . '/page/'); $curpage = $this->get('page') > 0 ? $this->get('page') : 1; $page->setPage($curpage); diff --git a/view/templates/index/formula_add.html b/view/templates/index/formula_add.html index 4f6e124..0e65183 100644 --- a/view/templates/index/formula_add.html +++ b/view/templates/index/formula_add.html @@ -88,7 +88,7 @@
ID | -录方者 | -药方名称 | -药方来源 | -使用次数 | -操作 | +ID | +录方者uid | +药方名称 | +药方来源 | +使用次数 | +药方详情 | +操作 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
{$item.id} | -{$item.uid} | +{if $item.uid eq 0}-{else}{$item.uid}{/if} | {$item.name} | {$item.source} | {$item.use_num} | - -{if $item.uid == 0}编辑{/if} | ++ {foreach from=$item.formula item=value} + {$value.name} {$value.num_str} + {/foreach} + | + ++ {if $item.uid == 0} + 编辑 + 删除 + {/if} + |