第二次提交
This commit is contained in:
@@ -43,8 +43,19 @@ class Article extends Base {
|
||||
$this->assign('article',$article);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function listdd(){
|
||||
$article_id = I('article_id/d',1);
|
||||
$article = Db::name('article')->where("article_id", $article_id)->find();
|
||||
if($article){
|
||||
$parent = Db::name('article_cat')->where("cat_id",$article['cat_id'])->find();
|
||||
$this->assign('cat_name',$parent['cat_name']);
|
||||
$this->assign('article',$article);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务协议
|
||||
* @return mixed
|
||||
|
@@ -271,7 +271,7 @@ class Goods extends Base
|
||||
$end_price = trim(I('end_price', '0')); // 输入框价钱
|
||||
if ($start_price && $end_price) $price = $start_price . '-' . $end_price; // 如果输入框有价钱 则使用输入框的价钱
|
||||
$q = urldecode(trim(I('q', ''))); // 关键字搜索
|
||||
empty($q) && $this->error('请输入搜索词');
|
||||
// empty($q) && $this->error('请输入搜索词');
|
||||
$id && ($filter_param['id'] = $id); //加入帅选条件中
|
||||
$brand_id && ($filter_param['brand_id'] = $brand_id); //加入帅选条件中
|
||||
$price && ($filter_param['price'] = $price); //加入帅选条件中
|
||||
|
68
application/home/controller/Illustrations.php
Normal file
68
application/home/controller/Illustrations.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* tpshop
|
||||
* ============================================================================
|
||||
* * 版权所有 2015-2027 深圳搜豹网络科技有限公司,并保留所有权利。
|
||||
* 网站地址: http://www.tp-shop.cn
|
||||
* ----------------------------------------------------------------------------
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
|
||||
* 不允许对程序代码以任何形式任何目的的再发布。
|
||||
* 采用最新Thinkphp5助手函数特性实现单字母函数M D U等简写方式
|
||||
* ============================================================================
|
||||
* $Author: IT宇宙人 2015-08-10 $
|
||||
*/
|
||||
|
||||
namespace app\home\controller;
|
||||
|
||||
|
||||
use app\common\logic\FreightLogic;
|
||||
use app\common\logic\GoodsPromFactory;
|
||||
use app\common\logic\SearchWordLogic;
|
||||
use app\common\logic\GoodsLogic;
|
||||
use app\common\model\Combination;
|
||||
use app\common\model\SpecGoodsPrice;
|
||||
use app\common\util\TpshopException;
|
||||
use think\AjaxPage;
|
||||
use think\Page;
|
||||
use think\Validate;
|
||||
use think\Verify;
|
||||
use think\Db;
|
||||
use think\Cookie;
|
||||
use think\Log;
|
||||
class Illustrations extends Base
|
||||
|
||||
{
|
||||
public function illustrations()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 商品咨询
|
||||
*/
|
||||
public function consult()
|
||||
{
|
||||
|
||||
$username = input("username", 'TPshop用户'); // 网友咨询
|
||||
$content = trim(input("content", '')); // 咨询内容
|
||||
$dess = trim(input("dess", '')); // 咨询内容
|
||||
$model = trim(input("model", '')); // 咨询内容
|
||||
|
||||
$data = array(
|
||||
'username' => $username,
|
||||
'content' => $content,
|
||||
'dess' => $dess,
|
||||
'model' => $model,
|
||||
'is_show' => 1,
|
||||
'add_time' => time(),
|
||||
);
|
||||
|
||||
|
||||
Db::name('goodsConsult')->add($data);
|
||||
$this->ajaxReturn(['status' => 1, 'msg' => '咨询已提交!']);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -30,6 +30,7 @@ class Index extends Base {
|
||||
$sql = "select a.goods_name,a.goods_id,a.shop_price,a.market_price,a.cat_id,b.parent_id_path,b.name from ".C('database.prefix')."goods as a left join ";
|
||||
$sql .= C('database.prefix')."goods_category as b on a.cat_id=b.id where a.is_hot=1 and a.is_on_sale=1 order by a.sort";//二级分类下热卖商品
|
||||
$index_hot_goods = S('index_hot_goods');
|
||||
//如果缓存没有index_hot_goods那么用$sql数据库查询首页也买商品
|
||||
if(empty($index_hot_goods))
|
||||
{
|
||||
$index_hot_goods = Db::query($sql);//首页热卖商品
|
||||
|
Reference in New Issue
Block a user