【类 型】:
【原 因】: 【过 程】: 【影 响】:
This commit is contained in:
parent
884e824710
commit
5fe976590a
@ -108,7 +108,7 @@ class CheckController extends PublicController
|
||||
exit(); //有问题跳出
|
||||
}
|
||||
|
||||
//后台校验 运费 打包费 和 前端提交值 ps:目前和商铺表 里的运费 打包费进行比较 后续可能要根据比如运输距离 商户根据订单单独修改的值 进行对比
|
||||
//后台校验 运费 打包费 和 前端提交值 ps:目前和单位表 里的运费 打包费进行比较 后续可能要根据比如运输距离 商户根据订单单独修改的值 进行对比
|
||||
$shopDb = D('shop');
|
||||
$whereShop['shop_id'] = $_REQUEST['shop_id'];
|
||||
$shop = $shopDb->where($whereShop)->find();
|
||||
|
@ -90,7 +90,7 @@ class NormalController extends PublicController
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @description: 获取商铺信息
|
||||
* @description: 获取单位信息
|
||||
*/
|
||||
public function getShopCon()
|
||||
{
|
||||
@ -99,7 +99,7 @@ class NormalController extends PublicController
|
||||
if ($shopCon = $shopDb->where($where)->find()) {
|
||||
echo json_encode(array('status' => 1, 'msg' => '访问成功', "shopCon" => $shopCon));
|
||||
} else {
|
||||
echo json_encode(array('status' => 0, 'msg' => '暂无商铺信息'));
|
||||
echo json_encode(array('status' => 0, 'msg' => '暂无单位信息'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class PayController extends PublicController
|
||||
$fieldShop = array('price_min', 'weight_max');
|
||||
$shopDb = D('shop');
|
||||
if (!$shop = $shopDb->where($whereShop)->field($fieldShop)->find()) {
|
||||
echo json_encode(array('status' => 0, 'msg' => '商铺不存在'));
|
||||
echo json_encode(array('status' => 0, 'msg' => '单位不存在'));
|
||||
exit();
|
||||
}
|
||||
if ($order['openid'] != $this->openid || (float)$order['total_price'] < (float)$shop['price_min'] || $order['total_weight'] > $shop['weight_max']) {
|
||||
|
@ -9,7 +9,7 @@ class AdminController extends PublicController
|
||||
echo "hello wolrd";
|
||||
}
|
||||
/**
|
||||
* @description: 获取商铺列表
|
||||
* @description: 获取单位列表
|
||||
*/
|
||||
public function getShopList()
|
||||
{
|
||||
@ -21,11 +21,11 @@ class AdminController extends PublicController
|
||||
if ($shopList = $shopDb->where($where)->select()) {
|
||||
echo json_encode(array('status' => 1, 'msg' => '访问成功', "shopList" => $shopList));
|
||||
} else {
|
||||
echo json_encode(array('status' => 0, 'msg' => '暂无商铺数据'));
|
||||
echo json_encode(array('status' => 0, 'msg' => '暂无单位数据'));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @description: 商铺添加
|
||||
* @description: 单位添加
|
||||
*/
|
||||
public function addShop()
|
||||
{
|
||||
@ -78,7 +78,7 @@ class AdminController extends PublicController
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @description: 商铺更新
|
||||
* @description: 单位更新
|
||||
*/
|
||||
public function saveShop()
|
||||
{
|
||||
@ -455,7 +455,7 @@ class AdminController extends PublicController
|
||||
*/
|
||||
public function deleteMessage()
|
||||
{
|
||||
// 权限判断(总管理员可操作所有商铺)
|
||||
// 权限判断(总管理员可操作所有单位)
|
||||
if ($this->tokenShop_id != C('powerId')) {
|
||||
$where['shop_id'] = $this->tokenShop_id;
|
||||
}
|
||||
|
@ -9,13 +9,16 @@
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace Behavior;
|
||||
|
||||
/**
|
||||
* 系统行为扩展:模板内容输出替换
|
||||
*/
|
||||
class ContentReplaceBehavior {
|
||||
class ContentReplaceBehavior
|
||||
{
|
||||
|
||||
// 行为扩展的执行入口必须是run
|
||||
public function run(&$content){
|
||||
public function run(&$content)
|
||||
{
|
||||
$content = $this->templateContentReplace($content);
|
||||
}
|
||||
|
||||
@ -25,7 +28,8 @@ class ContentReplaceBehavior {
|
||||
* @param string $content 模板内容
|
||||
* @return string
|
||||
*/
|
||||
protected function templateContentReplace($content) {
|
||||
protected function templateContentReplace($content)
|
||||
{
|
||||
// 系统默认的特殊变量替换
|
||||
$replace = array(
|
||||
'__ROOT__' => __ROOT__, // 当前网站地址
|
||||
@ -43,5 +47,4 @@ class ContentReplaceBehavior {
|
||||
$content = str_replace(array_keys($replace), array_values($replace), $content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
}
|
@ -9,10 +9,12 @@
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace Think;
|
||||
|
||||
/**
|
||||
* ThinkPHP 视图类
|
||||
*/
|
||||
class View {
|
||||
class View
|
||||
{
|
||||
/**
|
||||
* 模板输出变量
|
||||
* @var tVar
|
||||
@ -33,7 +35,8 @@ class View {
|
||||
* @param mixed $name
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function assign($name,$value=''){
|
||||
public function assign($name, $value = '')
|
||||
{
|
||||
if (is_array($name)) {
|
||||
$this->tVar = array_merge($this->tVar, $name);
|
||||
} else {
|
||||
@ -47,7 +50,8 @@ class View {
|
||||
* @param string $name
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($name=''){
|
||||
public function get($name = '')
|
||||
{
|
||||
if ('' === $name) {
|
||||
return $this->tVar;
|
||||
}
|
||||
@ -64,7 +68,8 @@ class View {
|
||||
* @param string $prefix 模板缓存前缀
|
||||
* @return mixed
|
||||
*/
|
||||
public function display($templateFile='',$charset='',$contentType='',$content='',$prefix='') {
|
||||
public function display($templateFile = '', $charset = '', $contentType = '', $content = '', $prefix = '')
|
||||
{
|
||||
G('viewStartTime');
|
||||
// 解析并获取模板内容
|
||||
$content = $this->fetch($templateFile, $content, $prefix);
|
||||
@ -80,7 +85,8 @@ class View {
|
||||
* @param string $contentType 输出类型
|
||||
* @return mixed
|
||||
*/
|
||||
private function render($content,$charset='',$contentType=''){
|
||||
private function render($content, $charset = '', $contentType = '')
|
||||
{
|
||||
if (empty($charset)) $charset = C('DEFAULT_CHARSET');
|
||||
if (empty($contentType)) $contentType = C('TMPL_CONTENT_TYPE');
|
||||
// 网页字符编码
|
||||
@ -99,7 +105,8 @@ class View {
|
||||
* @param string $prefix 模板缓存前缀
|
||||
* @return string
|
||||
*/
|
||||
public function fetch($templateFile='',$content='',$prefix='') {
|
||||
public function fetch($templateFile = '', $content = '', $prefix = '')
|
||||
{
|
||||
if (empty($content)) {
|
||||
$templateFile = $this->parseTemplate($templateFile);
|
||||
// 模板文件不存在直接返回
|
||||
@ -158,7 +165,8 @@ class View {
|
||||
* @param string $tmplTemplateFile 模板文件名
|
||||
* @return boolean
|
||||
*/
|
||||
protected function checkCache($tmplTemplateFile,$prefix='') {
|
||||
protected function checkCache($tmplTemplateFile, $prefix = '')
|
||||
{
|
||||
if (!C('TMPL_CACHE_ON')) // 优先对配置设定检测
|
||||
return false;
|
||||
$tmplCacheFile = C('CACHE_PATH') . $prefix . md5($tmplTemplateFile) . C('TMPL_CACHFILE_SUFFIX');
|
||||
@ -189,7 +197,8 @@ class View {
|
||||
* @param string $tmplContent 模板内容
|
||||
* @return boolean
|
||||
*/
|
||||
protected function checkContentCache($tmplContent,$prefix='') {
|
||||
protected function checkContentCache($tmplContent, $prefix = '')
|
||||
{
|
||||
if (Storage::has(C('CACHE_PATH') . $prefix . md5($tmplContent) . C('TMPL_CACHFILE_SUFFIX'))) {
|
||||
return true;
|
||||
} else {
|
||||
@ -203,7 +212,8 @@ class View {
|
||||
* @param string $template 模板文件规则
|
||||
* @return string
|
||||
*/
|
||||
public function parseTemplate($template='') {
|
||||
public function parseTemplate($template = '')
|
||||
{
|
||||
if (is_file($template)) {
|
||||
return $template;
|
||||
}
|
||||
@ -239,7 +249,8 @@ class View {
|
||||
* @param string $module 模块名
|
||||
* @return string
|
||||
*/
|
||||
protected function getThemePath($module=MODULE_NAME){
|
||||
protected function getThemePath($module = MODULE_NAME)
|
||||
{
|
||||
// 获取当前主题名称
|
||||
$theme = $this->getTemplateTheme();
|
||||
// 获取当前主题的模版路径
|
||||
@ -257,7 +268,8 @@ class View {
|
||||
* @param mixed $theme 主题名称
|
||||
* @return View
|
||||
*/
|
||||
public function theme($theme){
|
||||
public function theme($theme)
|
||||
{
|
||||
$this->theme = $theme;
|
||||
return $this;
|
||||
}
|
||||
@ -267,7 +279,8 @@ class View {
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
private function getTemplateTheme() {
|
||||
private function getTemplateTheme()
|
||||
{
|
||||
if ($this->theme) { // 指定模板主题
|
||||
$theme = $this->theme;
|
||||
} else {
|
||||
@ -289,5 +302,4 @@ class View {
|
||||
defined('THEME_NAME') || define('THEME_NAME', $theme); // 当前模板主题名称
|
||||
return $theme ? $theme . '/' : '';
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user