Commit aaa2370b by 施宇

Merge branch 'master' of http://119.23.72.7/shiyu/icsales

# Conflicts:
#	Application/Index/View/Index/index.html
parents 0c673254 8bed0325
Showing with 1604 additions and 166 deletions
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ic_www.iml" filepath="$PROJECT_DIR$/.idea/ic_www.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -5,7 +5,10 @@ return array(
'VAR_PAGE' => 'p',
'APP_SUB_DOMAIN_DEPLOY' => true,
'APP_SUB_DOMAIN_RULES' => array(
'www' => 'Index',
'home' => 'Home',
'search'=> 'Search',
'item' => 'Item'
),
'API_TOKEN' => 'zbPx8gDXDfIh3ZoJcO4EH', // api接口token
......
......@@ -44,32 +44,5 @@ return array(
//商详页(预留,原型暂时没有看到这个页面)
'itemicsales' => 'http://item.icsales.cc'
),
'URL_MAP_RULES' => array(//静态路由
'index' => 'Home/Index/index',
'indexsearch' => 'Home/Index/indexsearch',
'login' => 'Home/Index/login',
'register' => 'Home/Index/register',
'forget' => 'Home/Index/forget',
'homes' => 'Home/Index/home',
'inquiry' => 'Home/Index/inquiry',
'quote' => 'Home/Index/quote',
'account' => 'Home/Index/account',
'search' => 'Home/Index/search',
'releaseinquiry' => 'Home/Index/releaseinquiry',
'cert' => 'Home/Index/certification',
'inquirydetail' => 'Home/Index/inquirydetail',
'quotedetail' => 'Home/Index/quotedetail',
'roborder' => 'Home/Index/roborder',
'goodmanage' => 'Home/Index/goodmanage',
'uploadsingle' => 'Home/Index/uploadsingle',
'gooddetail' => 'Home/Index/gooddetail',
'bulkupload' => 'Home/Index/bulkupload',
'uploadresult' => 'Home/Index/uploadresult',
'integral' => 'Home/Index/integral',
'notice' => 'Home/Index/notice',
'chat' => 'Home/Index/chat',
'hotgoods' => 'Home/Cms/getHotGoods',
),
)
);
\ No newline at end of file
<?php
namespace Common\Controller;
use Think\Controller;
class BaseController extends Controller
{
public function _initialize()
{
$datas['logo'] = $this->apiBaseCache('pc_logo_set'); // logo
$datas['bottom_qrcode'] = $this->apiBaseCache('pc_bottom_qrcode'); // 底部二维码
$datas['hot_goods'] = $this->apiBaseCache('pc_hot_goods', '', 5); // 热门商品
foreach ($datas as $k => $v) {
$this->assign($k, $v['data']);
}
}
/**
* 通过bcat_id获取CMS分类数据 --- 图片、文字等
* @param [type] $tags [标签]
* @param [type] $where [搜索条件,用&连接,如:a=1&b=2]
* @param [type] $limit [数量]
* @return [type] [description]
*/
public function apiBaseCache($tags, $where='', $limit=1)
{
$cms = D('Home/Scms');
$datas = $cms->getBaseList($tags, $where, $limit);
if (!empty($datas)) {
return $this->apiReturn(0, '', $datas);
} else {
return $this->apiReturn(7004, '未找到数据');
}
}
/**
* 统一格式返回
* @param integer $code [description]
* @param string $msg [description]
* @param array $extend [description]
* @return [type] [description]
*/
protected function apiReturn($code = 0, $msg = '', $extend = array())
{
$data = array(
'err_code' => $code,
'err_msg' => $msg,
'data' => $extend,
);
if(isset($_GET['callback']) && !empty($_GET['callback'])){
echo $_GET['callback'].'('.json_encode($data).')';exit;
}else{
return $data;exit;
}
}
// 校验接口
protected function checkApi($request)
{
$timestamp = I('request.timestamp', '');
$random = I('request.random', '');
$signature = I('request.signature', '');
if (!$timestamp && !$random && !$signature) return false;
if ($timestamp < time() - 300) return false;
$sign = createSignature($timestamp, $random);
if ($signature != $sign) return false;
return true;
}
}
\ No newline at end of file
<?php
namespace Common\Controller;
use Common\Controller\BaseController;
class CmsController extends BaseController
{
// 获取热门商品
public function getHotGoods()
{
$res = $this->checkApi(); // 接口校验
if ($res === false) return $this->jsonReturn(11001, '接口校验失败');
$datas = $this->apiBaseCache('pc_hot_goods', '', 5); // 热门商品
return $this->jsonReturn(0, '', $datas['data']);
}
/**
* 统一格式返回
* @param integer $code [description]
* @param string $msg [description]
* @param array $extend [description]
* @return [type] [description]
*/
protected function jsonReturn($code = 0, $msg = '', $extend = array())
{
$data = array(
'err_code' => $code,
'err_msg' => $msg,
'data' => $extend,
);
if(isset($_GET['callback']) && !empty($_GET['callback'])){
echo $_GET['callback'].'('.json_encode($data).')';exit;
}else{
echo json_encode($data);exit;
}
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
<img src="__PUBLIC__/images/default.jpg" alt="IC" title="IC">
</a>
</div>
<a class="message_icon fr" href="/notice">
<a class="message_icon fr" href="../../../../index.php">
<span class="icon iconfont iconjuxing1"></span>
<span class="num" id="count_num">0</span>
</a>
......
<?php
return array(
'LOAD_EXT_CONFIG' => 'config_url',
);
\ No newline at end of file
<?php
return array(
'URL_MAP_RULES' => array(//静态路由
'index' => 'Index/index',
'homes' => 'Index/index',
'inquiry' => 'Index/inquiry',
'quote' => 'Index/quote',
'account' => 'Index/account',
'search' => 'Index/search',
'releaseinquiry' => 'Index/releaseinquiry',
'cert' => 'Index/certification',
'inquirydetail' => 'Index/inquirydetail',
'quotedetail' => 'Index/quotedetail',
'roborder' => 'Index/roborder',
'goodmanage' => 'Index/goodmanage',
'uploadsingle' => 'Index/uploadsingle',
'gooddetail' => 'Index/gooddetail',
'bulkupload' => 'Index/bulkupload',
'uploadresult' => 'Index/uploadresult',
'integral' => 'Index/integral',
'notice' => 'Index/notice',
'chat' => 'Index/chat',
'hotgoods' => 'Cms/getHotGoods',
)
);
......@@ -2,70 +2,23 @@
namespace Home\Controller;
use Home\Controller\BaseController;
use Common\Controller\BaseController;
class IndexController extends BaseController
{
public function _initialize()
{
parent::_initialize();
if (!cookie('token') && ACTION_NAME != 'login' && ACTION_NAME != 'register' && ACTION_NAME != 'index' && ACTION_NAME != 'indexsearch' && ACTION_NAME != 'forget') {
if (!cookie('token')) {
$this->redirect('/login');
}
}
/**
* 首页
*/
public function index()
{
$datas['cooperation_pf'] = $this->apiBaseCache('pc_home_cooperation_pf', '', ''); // 合作平台
foreach ($datas as $k => $v) {
$this->assign($k, $v['data']);
}
$this->display('Index/index');
}
/**
* 首页搜索结果
*/
public function indexsearch()
{
$this->display('Index/search');
}
/**
* 登录页面
*/
public function login()
{
$this->display('Login/index');
}
/**
* 注册页面
*/
public function register()
{
$this->display('Register/index');
}
/**
* 忘记密码
*/
public function forget()
{
$this->display('Forget/index');
}
/**
* 后台管理首页
*/
public function home()
public function index()
{
$this->display('Home/index');
}
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/account.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content release_inquiry_content">
<div class="content">
<div class="nav_title">账户设置 > 基本设置</div>
......@@ -162,7 +162,7 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/global/observer.js"></script>
<script src="__PUBLIC__/js/account/index.js"></script>
<!--省-->
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/certification.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content certification_content">
<div class="content layui-form">
<div class="nav_title">认证管理 > 我的认证 > 添加认证</div>
......@@ -95,7 +95,7 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/certification/index.js"></script>
<script type="text/html" id="certtHtml">
{{# if (d == '1') { }}
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/chat.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content chat_content">
<div class="content">
<div class="content_div">
......@@ -79,7 +79,7 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<!--[if lt IE 9]>
<script>
layer.open({
......
......@@ -2,7 +2,7 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bulkupload.css">
<style>
</style>
......@@ -10,9 +10,9 @@
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content upload_bulk_content">
<div class="content">
<div class="nav_title">商品管理 > 发布商品 > 批量上传</div>
......@@ -66,7 +66,7 @@
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/goodmanage/bulkupload.js"></script>
</body>
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/gooddetail.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content good_detail_content">
<div class="content">
<div class="nav_title">
......@@ -29,7 +29,7 @@
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/goodmanage/gooddetail.js"></script>
<script type="text/html" id="navTpl">
询报价
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header"/>
<include file="Common@public/header"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/goodmanage.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft"/>
<include file="Common@public/navleft"/>
<div class="wrapper_right">
<include file="public/top"/>
<include file="Common@public/top"/>
<div class="right_content good_manage_content">
<div class="content">
<div class="nav_title">商品管理 > 商品列表</div>
......@@ -114,7 +114,7 @@
</div>
</div>
<include file="public/foot"/>
<include file="Common@public/foot"/>
<script src="__PUBLIC__/js/goodmanage/index.js"></script>
<script type="text/html" id="listHtml">
<div class="data_list">
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header"/>
<include file="Common@public/header"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/uploadresult.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft"/>
<include file="Common@public/navleft"/>
<div class="wrapper_right">
<include file="public/top"/>
<include file="Common@public/top"/>
<div class="right_content upload_result_content">
<div class="content">
<div class="nav_title">商品管理 > 发布商品 > 上传结果</div>
......@@ -42,7 +42,7 @@
</div>
</div>
<include file="public/foot"/>
<include file="Common@public/foot"/>
<script src="__PUBLIC__/js/goodmanage/uploadresult.js"></script>
<script type="text/html" id="listHtml">
<div class="data_list">
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/releaseinquiry.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content upload_single_content">
<div class="content">
<div class="nav_title">商品管理 > 发布商品 > 上传商品</div>
......@@ -124,7 +124,7 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/goodmanage/uploadsingle.js"></script>
<script type="text/html" id="deliveryHtml">
{{# if (d=='期货') { }}
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/home.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content home_content">
<div class="content">
<div class="user_info clr user_home">
......@@ -80,7 +80,7 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/home/index.js"></script>
<script type="text/html" id="hotTpl">
{{# if(d.length != 0){ }}
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/integral.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content inquiry_content">
<div class="content">
<div class="nav_title">积分管理 > 积分列表</div>
......@@ -102,7 +102,7 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script>
layui.use('laydate', function () {
var laydate = layui.laydate;
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header"/>
<include file="Common@public/header"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/notice.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft"/>
<include file="Common@public/navleft"/>
<div class="wrapper_right">
<include file="public/top"/>
<include file="Common@public/top"/>
<div class="right_content notice_content">
<div class="content">
<div class="content_div">
......@@ -33,7 +33,7 @@
</div>
</div>
</div>
<include file="public/foot"/>
<include file="Common@public/foot"/>
<script src="__PUBLIC__/js/global/observer.js"></script>
<script src="__PUBLIC__/js/notice/index.js"></script>
<script type="text/html" id="msgHtml">
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/inquiry.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content inquiry_content">
<div class="edit_div">
<span class=" icon iconfont iconjuxing14"></span>
......@@ -67,7 +67,7 @@
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/quoteprice/inquiry.js"></script>
<!-- 询价模板 -->
<script type="text/html" id="htmlTp">
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/inquirydetail.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content inquiry_detail_content">
<div class="content">
<div class="nav_title">
......@@ -27,7 +27,7 @@
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/quoteprice/inquirydetail.js"></script>
<script type="text/html" id="navTpl">
<!-- 导航的详情 -->
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/inquiry.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content quote_content">
<div class="content">
<div class="nav_title">询报价 > 我的报价</div>
......@@ -64,7 +64,7 @@
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/quoteprice/quote.js"></script>
<script type="text/html" id="myBj">
<!-- 我的报价列表 -->
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/inquirydetail.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content quote_detail_content">
<div class="content">
<div class="nav_title">
......@@ -105,7 +105,7 @@
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/quoteprice/quotedetail.js"></script>
<script type="text/html" id="navTpl">
<!-- 导航的详情 -->
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/releaseinquiry.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content release_inquiry_content">
<div class="content">
<div class="nav_title">询报价 > 发布询价</div>
......@@ -131,7 +131,7 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/quoteprice/releaseinquiry.js"></script>
<script type="text/html" id="deliveryHtml">
{{# if (d=='期货') { }}
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/roborder.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content roborder_content">
<div class="edit_div">
<span class=" icon iconfont iconjuxing14"></span>
......@@ -35,7 +35,7 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/roborder/index.js"></script>
<script type="text/html" id="zqTpl">
<div class="my_xj_list clr ">
......
......@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/search.css">
</head>
<body>
<div class="wrapper">
<include file="public/navleft" />
<include file="Common@public/navleft" />
<div class="wrapper_right">
<include file="public/top" />
<include file="Common@public/top" />
<div class="right_content search_content">
<div class="content">
<div class="search_section ">
......@@ -57,7 +57,7 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/search/index.js"></script>
<!-- 页面模板 -->
<script type="text/html" id="sphtml">
......
<?php
return array(
'LOAD_EXT_CONFIG' => 'config_url',
);
\ No newline at end of file
<?php
return array(
'URL_MAP_RULES' => array(//静态路由
)
);
<?php
namespace Index\Controller;
use Common\Controller\BaseController;
class IndexController extends BaseController
{
/**
* 首页
*/
public function index()
{
$datas['cooperation_pf'] = $this->apiBaseCache('pc_home_cooperation_pf', '', ''); // 合作平台
foreach ($datas as $k => $v) {
$this->assign($k, $v['data']);
}
$this->display('Index/index');
}
}
<?php
/**
* 获取CMS缓存
*/
namespace Home\Model;
class ScmsModel
{
/**
* 获取bcat_id
* @param [type] $key [键]
* @param integer $type [取值类型:1-通过tags,2-通过tem_id(楼层类目)]
* @return [type] [description]
*/
public function getBcatId($key, $type=1)
{
return $type == 1 ? S_cms('icsales:lie_base_cat:tags', $key, 'bcat_id') : S_cms('icsales:lie_base_cat:tem_id:'.$key);
}
/**
* 获取base数据
* @param [type] $key [键]
* @param string $limit [限制数量]
* @param integer $type [取值类型:1-通过bcat_id, 2-通过tem_id,3-通过model_id]
* @return [type] $condition [搜索条件,用&连接,如:a=1&b=2]
* @param [type] $table [表名]
* @return [type] [description]
*/
public function getBase($key, $limit='', $condition='', $type=1, $table='lie_base')
{
if ($type == 1)
$datas = S_cms('icsales:'.$table.':bcat_id:'.$key, '', '', 'sort');
else if ($type == 2)
$datas = S_cms('icsales:'.$table.':tem_id:'.$key, '', '', 'sort');
else
$datas = S_cms('icsales:'.$table.':model_id:'.$key, '', '', 'sort');
if (!$datas) return $datas;
if ($condition) {
parse_str($condition, $arr); // 解析条件,输出数组
$isTrue = true;
$datas = array_filter($datas, function($base) use ($arr, $isTrue) {
foreach ($arr as $k=>$v) {
if (isset($base[$k]) && $base[$k] != $v) { // 判断每个搜索条件是否存在且值相等,若不相等,则过滤对应的datas数组值
$isTrue = false;
}
}
return $isTrue;
});
array_multisort($datas); // 重新索引
}
$datas = $limit ? array_slice($datas, 0, $limit) : $datas;
return $datas;
}
/**
* 获取Base表配置内容
* @param [type] $tags [tags值]
* @param string $where [条件]
* @param string $limit [限制数量]
* @return [type] [description]
*/
public function getBaseList($tags, $where='', $limit=1)
{
$bcat_id = $this->getBcatId($tags); // 分类ID
return $this->getBase($bcat_id, $limit, $where);
}
/**
* 获取楼层模板
* @param [type] $key [键]
* @return [type] [description]
*/
public function getTemplate($key)
{
return S_cms('icsales:lie_template:tag:'.$key, '', '', 'sort');
}
/**
* 获取模块
* @param [type] $field [字段值]
* @param string $column [指定列]
* @return [type] [description]
*/
public function getModel($field, $column='')
{
return $column ? S_cms('icsales:lie_model:model_key', $field, $column) : S_cms('icsales:lie_model:model_key', $field);
}
/**
* 获取导航
* @param integer $model_id [所属模块ID]
* @param integer $parent_id [所属父级ID] <先查找模块下所有导航,遍历后,根据nav_id查找对应子级>
* @return [type] [description]
*/
public function getNavigation($model_id, $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_navigation:model_id:'.$model_id, '', '', 'sort') : S_cms('icsales:lie_navigation:model_id:'.$model_id.':parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取帮助中心分类
* @param integer $model_id [所属模块ID]
* @param integer $parent_id [所属父级ID] <先查找模块下所有分类,遍历后,根据hccat_id查找对应子级>
* @return [type] [description]
*/
public function getHelpCenterCat($model_id, $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_help_center_cat:model_id:'.$model_id, '', '', 'sort') : S_cms('icsales:lie_help_center_cat:model_id:'.$model_id.':parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取帮助中心内容
* @param [type] $hccat_id [帮助中心分类ID]
* @return [type] [description]
*/
public function getHelpCenter($hccat_id)
{
return S_cms('icsales:lie_help_center:hccat_id:'.$hccat_id, '', '', 'sort');
}
/**
* 获取底部链接分类
* @param integer $fcat_key [所属模块ID]
* @param integer $column [指定字段]
* @param integer $parent_id [所属父级ID] <先查找模块下所有分类,遍历后,根据fcat_id查找对应子级>
* @return [type] [description]
*/
public function getFooterLinkCat($fcat_key, $column='', $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_footer_link_cat:fcat_key', $fcat_key, $column, 'sort') : S_cms('icsales:lie_footer_link_cat:parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取底部链接内容
* @param [type] $fcat_id [帮助中心分类ID]
* @return [type] [description]
*/
public function getFooterLink($fcat_id)
{
return S_cms('icsales:lie_footer_link:fcat_id:'.$fcat_id, '', '', 'sort');
}
/**
* 获取页面分类
* @param integer $model_id [所属模块ID]
* @return [type] [description]
*/
public function getPageCat($model_id)
{
return S_cms('icsales:lie_page_cat:model_id:'.$model_id);
}
/**
* 获取页面内容
* @param [type] $pagecat_id [页面分类ID]
* @return [type] [description]
*/
public function getPage($pagecat_id)
{
return S_cms('icsales:lie_page:pagecat_id:'.$pagecat_id);
}
/************************************** 信宏泰配置 **************************************/
/**
* 获取公司
* @return [type] [description]
*/
public function getCompany()
{
return S_cms('icsales:xht:lie_company', '', '', 'sort');
}
/**
* 获取公司信息
* @param [type] $com_id [公司ID]
* @return [type] [description]
*/
public function getCompanyInfo($com_id)
{
return S_cms('icsales:xht:lie_company_info:com_id:'.$com_id, '', '', 'sort');
}
/**
* 获取公司图片
* @param [type] $com_id [公司ID]
* @return [type] [description]
*/
public function getCompanyImg($com_id)
{
return S_cms('icsales:xht:lie_company_img:com_id:'.$com_id, '', '', 'sort');
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/index.css">
<style>
.search_section,
......@@ -17,7 +17,7 @@
<body>
<!-- pc下的页面 -->
<div class="index_wrapper pc_wrapper">
<include file="public/indexheader" />
<include file="Common@public/indexheader" />
<div class="content index_content">
<div class="top_section">
<div class="search_section">
......@@ -142,7 +142,7 @@
</div>
</div>
</div>
<include file="public/indexfoot" />
<include file="Common@public/indexfoot" />
</div>
<!-- pc下的页面 -->
......@@ -253,7 +253,7 @@
</div>
</div>
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<!-- 移动端下的页面 -->
<script>
$('.index_wrapper .lb_nav span').click(function () {
......
......@@ -2,13 +2,13 @@
<html lang="zh-CN">
<head>
<include file="public/header" />
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/indexsearch.css">
</head>
<body>
<div class="index_wrapper search_wrapper">
<include file="public/indexheader" />
<include file="Common@public/indexheader" />
<div class="content">
<div class="width_1190">
<div class="search_section ">
......@@ -51,9 +51,9 @@
</div>
</div>
</div>
<include file="public/indexfoot" />
<include file="Common@public/indexfoot" />
</div>
<include file="public/foot" />
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/index/search.js"></script>
<!-- 商品模板 -->
<script type="text/html" id="sphtml">
......
\ No newline at end of file
<?php
return array(
'LOAD_EXT_CONFIG' => 'config_url',
);
\ No newline at end of file
<?php
return array(
'URL_MAP_RULES' => array(//静态路由
'login' => 'Home/Index/login',
'register' => 'Home/Index/register',
'forget' => 'Home/Index/forget',
)
);
<?php
namespace Passport\Controller;
use Common\Controller\BaseController;
class IndexController extends BaseController
{
/**
* 登录页面
*/
public function login()
{
$this->display('Login/index');
}
/**
* 注册页面
*/
public function register()
{
$this->display('Register/index');
}
/**
* 忘记密码
*/
public function forget()
{
$this->display('Forget/index');
}
}
<?php
/**
* 获取CMS缓存
*/
namespace Home\Model;
class ScmsModel
{
/**
* 获取bcat_id
* @param [type] $key [键]
* @param integer $type [取值类型:1-通过tags,2-通过tem_id(楼层类目)]
* @return [type] [description]
*/
public function getBcatId($key, $type=1)
{
return $type == 1 ? S_cms('icsales:lie_base_cat:tags', $key, 'bcat_id') : S_cms('icsales:lie_base_cat:tem_id:'.$key);
}
/**
* 获取base数据
* @param [type] $key [键]
* @param string $limit [限制数量]
* @param integer $type [取值类型:1-通过bcat_id, 2-通过tem_id,3-通过model_id]
* @return [type] $condition [搜索条件,用&连接,如:a=1&b=2]
* @param [type] $table [表名]
* @return [type] [description]
*/
public function getBase($key, $limit='', $condition='', $type=1, $table='lie_base')
{
if ($type == 1)
$datas = S_cms('icsales:'.$table.':bcat_id:'.$key, '', '', 'sort');
else if ($type == 2)
$datas = S_cms('icsales:'.$table.':tem_id:'.$key, '', '', 'sort');
else
$datas = S_cms('icsales:'.$table.':model_id:'.$key, '', '', 'sort');
if (!$datas) return $datas;
if ($condition) {
parse_str($condition, $arr); // 解析条件,输出数组
$isTrue = true;
$datas = array_filter($datas, function($base) use ($arr, $isTrue) {
foreach ($arr as $k=>$v) {
if (isset($base[$k]) && $base[$k] != $v) { // 判断每个搜索条件是否存在且值相等,若不相等,则过滤对应的datas数组值
$isTrue = false;
}
}
return $isTrue;
});
array_multisort($datas); // 重新索引
}
$datas = $limit ? array_slice($datas, 0, $limit) : $datas;
return $datas;
}
/**
* 获取Base表配置内容
* @param [type] $tags [tags值]
* @param string $where [条件]
* @param string $limit [限制数量]
* @return [type] [description]
*/
public function getBaseList($tags, $where='', $limit=1)
{
$bcat_id = $this->getBcatId($tags); // 分类ID
return $this->getBase($bcat_id, $limit, $where);
}
/**
* 获取楼层模板
* @param [type] $key [键]
* @return [type] [description]
*/
public function getTemplate($key)
{
return S_cms('icsales:lie_template:tag:'.$key, '', '', 'sort');
}
/**
* 获取模块
* @param [type] $field [字段值]
* @param string $column [指定列]
* @return [type] [description]
*/
public function getModel($field, $column='')
{
return $column ? S_cms('icsales:lie_model:model_key', $field, $column) : S_cms('icsales:lie_model:model_key', $field);
}
/**
* 获取导航
* @param integer $model_id [所属模块ID]
* @param integer $parent_id [所属父级ID] <先查找模块下所有导航,遍历后,根据nav_id查找对应子级>
* @return [type] [description]
*/
public function getNavigation($model_id, $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_navigation:model_id:'.$model_id, '', '', 'sort') : S_cms('icsales:lie_navigation:model_id:'.$model_id.':parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取帮助中心分类
* @param integer $model_id [所属模块ID]
* @param integer $parent_id [所属父级ID] <先查找模块下所有分类,遍历后,根据hccat_id查找对应子级>
* @return [type] [description]
*/
public function getHelpCenterCat($model_id, $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_help_center_cat:model_id:'.$model_id, '', '', 'sort') : S_cms('icsales:lie_help_center_cat:model_id:'.$model_id.':parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取帮助中心内容
* @param [type] $hccat_id [帮助中心分类ID]
* @return [type] [description]
*/
public function getHelpCenter($hccat_id)
{
return S_cms('icsales:lie_help_center:hccat_id:'.$hccat_id, '', '', 'sort');
}
/**
* 获取底部链接分类
* @param integer $fcat_key [所属模块ID]
* @param integer $column [指定字段]
* @param integer $parent_id [所属父级ID] <先查找模块下所有分类,遍历后,根据fcat_id查找对应子级>
* @return [type] [description]
*/
public function getFooterLinkCat($fcat_key, $column='', $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_footer_link_cat:fcat_key', $fcat_key, $column, 'sort') : S_cms('icsales:lie_footer_link_cat:parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取底部链接内容
* @param [type] $fcat_id [帮助中心分类ID]
* @return [type] [description]
*/
public function getFooterLink($fcat_id)
{
return S_cms('icsales:lie_footer_link:fcat_id:'.$fcat_id, '', '', 'sort');
}
/**
* 获取页面分类
* @param integer $model_id [所属模块ID]
* @return [type] [description]
*/
public function getPageCat($model_id)
{
return S_cms('icsales:lie_page_cat:model_id:'.$model_id);
}
/**
* 获取页面内容
* @param [type] $pagecat_id [页面分类ID]
* @return [type] [description]
*/
public function getPage($pagecat_id)
{
return S_cms('icsales:lie_page:pagecat_id:'.$pagecat_id);
}
/************************************** 信宏泰配置 **************************************/
/**
* 获取公司
* @return [type] [description]
*/
public function getCompany()
{
return S_cms('icsales:xht:lie_company', '', '', 'sort');
}
/**
* 获取公司信息
* @param [type] $com_id [公司ID]
* @return [type] [description]
*/
public function getCompanyInfo($com_id)
{
return S_cms('icsales:xht:lie_company_info:com_id:'.$com_id, '', '', 'sort');
}
/**
* 获取公司图片
* @param [type] $com_id [公司ID]
* @return [type] [description]
*/
public function getCompanyImg($com_id)
{
return S_cms('icsales:xht:lie_company_img:com_id:'.$com_id, '', '', 'sort');
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
<html lang="zh-CN">
<head>
<include file="public/header"/>
<include file="Common@public/header"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/person.css">
</head>
......@@ -82,7 +82,7 @@
</div>
<b class="lineBlock emptys"></b>
<include file="public/foot"/>
<include file="Common@public/foot"/>
<script src="__PUBLIC__/js/person/forget.js"></script>
<script type="text/html" id="pwdHtml">
{{# if (d.flag== 1) { }}
......
......@@ -2,7 +2,7 @@
<html lang="zh-CN">
<head>
<include file="public/header"/>
<include file="Common@public/header"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/person.css">
</head>
......@@ -126,7 +126,7 @@
</div>
<b class="lineBlock emptys"></b>
<include file="public/foot"/>
<include file="Common@public/foot"/>
<script src="__PUBLIC__/js/person/login.js"></script>
<script type="text/html" id="pwdHtml">
{{# if (d.flag== 1) { }}
......
......@@ -2,7 +2,7 @@
<html lang="zh-CN">
<head>
<include file="public/header"/>
<include file="Common@public/header"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/person.css">
</head>
......@@ -67,7 +67,7 @@
</div>
<b class="lineBlock emptys"></b>
<include file="public/foot"/>
<include file="Common@public/foot"/>
<script src="__PUBLIC__/js/person/register.js"></script>
<script type="text/html" id="pwdHtml">
......
\ No newline at end of file
<?php
return array(
'LOAD_EXT_CONFIG' => 'config_url',
);
\ No newline at end of file
<?php
return array(
'URL_ROUTE_RULES' => array(//动态路由
'/^(\w+)_(\d+)_(\d+)$/' => 'Index/indexsearch?key=:1&type=:2&time=:3',
)
);
<?php
namespace Search\Controller;
use Common\Controller\BaseController;
class IndexController extends BaseController
{
/**
* 首页搜索结果
*/
public function indexsearch()
{
$this->display('Index/search');
}
}
<?php
/**
* 获取CMS缓存
*/
namespace Home\Model;
class ScmsModel
{
/**
* 获取bcat_id
* @param [type] $key [键]
* @param integer $type [取值类型:1-通过tags,2-通过tem_id(楼层类目)]
* @return [type] [description]
*/
public function getBcatId($key, $type=1)
{
return $type == 1 ? S_cms('icsales:lie_base_cat:tags', $key, 'bcat_id') : S_cms('icsales:lie_base_cat:tem_id:'.$key);
}
/**
* 获取base数据
* @param [type] $key [键]
* @param string $limit [限制数量]
* @param integer $type [取值类型:1-通过bcat_id, 2-通过tem_id,3-通过model_id]
* @return [type] $condition [搜索条件,用&连接,如:a=1&b=2]
* @param [type] $table [表名]
* @return [type] [description]
*/
public function getBase($key, $limit='', $condition='', $type=1, $table='lie_base')
{
if ($type == 1)
$datas = S_cms('icsales:'.$table.':bcat_id:'.$key, '', '', 'sort');
else if ($type == 2)
$datas = S_cms('icsales:'.$table.':tem_id:'.$key, '', '', 'sort');
else
$datas = S_cms('icsales:'.$table.':model_id:'.$key, '', '', 'sort');
if (!$datas) return $datas;
if ($condition) {
parse_str($condition, $arr); // 解析条件,输出数组
$isTrue = true;
$datas = array_filter($datas, function($base) use ($arr, $isTrue) {
foreach ($arr as $k=>$v) {
if (isset($base[$k]) && $base[$k] != $v) { // 判断每个搜索条件是否存在且值相等,若不相等,则过滤对应的datas数组值
$isTrue = false;
}
}
return $isTrue;
});
array_multisort($datas); // 重新索引
}
$datas = $limit ? array_slice($datas, 0, $limit) : $datas;
return $datas;
}
/**
* 获取Base表配置内容
* @param [type] $tags [tags值]
* @param string $where [条件]
* @param string $limit [限制数量]
* @return [type] [description]
*/
public function getBaseList($tags, $where='', $limit=1)
{
$bcat_id = $this->getBcatId($tags); // 分类ID
return $this->getBase($bcat_id, $limit, $where);
}
/**
* 获取楼层模板
* @param [type] $key [键]
* @return [type] [description]
*/
public function getTemplate($key)
{
return S_cms('icsales:lie_template:tag:'.$key, '', '', 'sort');
}
/**
* 获取模块
* @param [type] $field [字段值]
* @param string $column [指定列]
* @return [type] [description]
*/
public function getModel($field, $column='')
{
return $column ? S_cms('icsales:lie_model:model_key', $field, $column) : S_cms('icsales:lie_model:model_key', $field);
}
/**
* 获取导航
* @param integer $model_id [所属模块ID]
* @param integer $parent_id [所属父级ID] <先查找模块下所有导航,遍历后,根据nav_id查找对应子级>
* @return [type] [description]
*/
public function getNavigation($model_id, $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_navigation:model_id:'.$model_id, '', '', 'sort') : S_cms('icsales:lie_navigation:model_id:'.$model_id.':parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取帮助中心分类
* @param integer $model_id [所属模块ID]
* @param integer $parent_id [所属父级ID] <先查找模块下所有分类,遍历后,根据hccat_id查找对应子级>
* @return [type] [description]
*/
public function getHelpCenterCat($model_id, $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_help_center_cat:model_id:'.$model_id, '', '', 'sort') : S_cms('icsales:lie_help_center_cat:model_id:'.$model_id.':parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取帮助中心内容
* @param [type] $hccat_id [帮助中心分类ID]
* @return [type] [description]
*/
public function getHelpCenter($hccat_id)
{
return S_cms('icsales:lie_help_center:hccat_id:'.$hccat_id, '', '', 'sort');
}
/**
* 获取底部链接分类
* @param integer $fcat_key [所属模块ID]
* @param integer $column [指定字段]
* @param integer $parent_id [所属父级ID] <先查找模块下所有分类,遍历后,根据fcat_id查找对应子级>
* @return [type] [description]
*/
public function getFooterLinkCat($fcat_key, $column='', $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_footer_link_cat:fcat_key', $fcat_key, $column, 'sort') : S_cms('icsales:lie_footer_link_cat:parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取底部链接内容
* @param [type] $fcat_id [帮助中心分类ID]
* @return [type] [description]
*/
public function getFooterLink($fcat_id)
{
return S_cms('icsales:lie_footer_link:fcat_id:'.$fcat_id, '', '', 'sort');
}
/**
* 获取页面分类
* @param integer $model_id [所属模块ID]
* @return [type] [description]
*/
public function getPageCat($model_id)
{
return S_cms('icsales:lie_page_cat:model_id:'.$model_id);
}
/**
* 获取页面内容
* @param [type] $pagecat_id [页面分类ID]
* @return [type] [description]
*/
public function getPage($pagecat_id)
{
return S_cms('icsales:lie_page:pagecat_id:'.$pagecat_id);
}
/************************************** 信宏泰配置 **************************************/
/**
* 获取公司
* @return [type] [description]
*/
public function getCompany()
{
return S_cms('icsales:xht:lie_company', '', '', 'sort');
}
/**
* 获取公司信息
* @param [type] $com_id [公司ID]
* @return [type] [description]
*/
public function getCompanyInfo($com_id)
{
return S_cms('icsales:xht:lie_company_info:com_id:'.$com_id, '', '', 'sort');
}
/**
* 获取公司图片
* @param [type] $com_id [公司ID]
* @return [type] [description]
*/
public function getCompanyImg($com_id)
{
return S_cms('icsales:xht:lie_company_img:com_id:'.$com_id, '', '', 'sort');
}
}
\ No newline at end of file
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/indexsearch.css">
</head>
<body>
<div class="index_wrapper search_wrapper">
<include file="Common@public/indexheader" />
<div class="content">
<div class="width_1190">
<div class="search_section ">
<div class="search_div clr">
<div class="input_div fl">
<span class="icon iconfont iconjuxing"></span>
<input type="text" placeholder="请输入要搜索的内容" class="input-search">
</div>
<div class="input_btn fl btn_48 btn bold btn_blue">
搜索
</div>
</div>
</div>
<div class="nav_title">
首页 > 搜索 > 搜索结果 > <span>0</span>信息
</div>
<div class="search_condition">
<ul class="search_nav clr">
<li class="search_sp fl ">商品</li>
<li class="search_xj fl">询价</li>
</ul>
<div class="zz condition_content">
<span class="bold">时间:</span>
<div class="condition_right_content clr">
<div class="fl jt">今天</div>
<div class="fl st">三天之内</div>
<div class="fl qt">七天之内</div>
</div>
</div>
<!-- <div class="fz condition_content ">
<span class="bold">封装:</span>
<div class="condition_right_content clr">
<div class="fl">贸易商</div>
<div class="fl">贸易商</div>
<div class="fl">贸易商</div>
</div>
</div> -->
</div>
<div class="goods_data_list search_data_list">
</div>
</div>
</div>
<include file="Common@public/indexfoot" />
</div>
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/index/search.js"></script>
<!-- 商品模板 -->
<script type="text/html" id="sphtml">
<div class="my_xj_list clr ">
{{# layui.each(d, function(index, item){ }}
<div class="my_xj_item fl boxsiz">
<div class="item_top clr">
<div class="fl num ellipsis">{{item.goods_name}}</div>
</div>
<div class="item_middle clr">
<div class="fl price">
{{# if(item.currency == 1){ }}
{{# } else { }}
$
{{# } }}
{{item.price}}
</div>
<div class="fr time">{{layui.util.toDateString(item.update_time * 1000,'yyyy-MM-dd HH:mm')}}</div>
</div>
<div class="item_bottom">
<div class="brand">品牌:<span>{{item.brand_name}}</span></div>
<div class="total">数量:<span class="bold">{{item.stock}} PCS</span></div>
<div class="date">货期:<span class="bold">现货</span></div>
</div>
<div class="item_user">
<span class="fl type mystype lineBlock">
{{# if(item.company_type!==""){ }}
{{# if(item.company_type==1){ }}
贸易商
{{# } }}
{{# if(item.company_type==2){ }}
代理商
{{# } }}
{{# if(item.company_type==3){ }}
原厂
{{# } }}
{{# if(item.company_type==4){ }}
制造商
{{# } }}
{{# if(item.company_type==5){ }}
个人用户
{{# } }}
{{# } else { }}
--
{{# } }}
</span>
<div class="fl name ellipsis">{{item.company_name||''}}</div>
</div>
</div>
{{# }); }}
</div>
{{# if(d.length === 0){ }}
<div class="no_data" style="padding:60px 0 60px">
<img src="__PUBLIC__/images/nosearchdata.png" alt="">
<p class="bold">未搜索到相关信息</p>
</div>
{{# } }}
<div class="btn_div">
<a class="btn btn_blue" href="passporticsales/login">登录,查看更多结果</a>
</div>
</script>
<!-- 询价模板 -->
<script type="text/html" id="xjhtml">
<div class="my_xj_list clr ">
{{# layui.each(d, function(index, item){ }}
<div class="my_xj_item fl boxsiz">
<div class="item_top clr">
<div class="fl num ellipsis">{{item.goods_name}}</div>
</div>
<div class="item_middle clr">
{{# if(item.offer_num != 0){ }}
<div class="fl xjNum">{{item.offer_num}}个报价</div>
{{# } else { }}
<div class="fl xj0">等待报价</div>
{{# } }}
<div class="fr time">{{layui.util.toDateString(item.add_time * 1000,'yyyy-MM-dd HH:mm')}}</div>
</div>
<div class="item_bottom">
<div class="brand">品牌:<span>{{item.brand_name}}</span></div>
<div class="total">数量:<span class="bold">{{item.number}} PCS</span></div>
<div class="date">货期:<span class="bold">现货</span></div>
</div>
<div class="item_user">
<span class="fl type mystype lineBlock">
{{# if(item.company_type!==""){ }}
{{# if(item.company_type==1){ }}
贸易商
{{# } }}
{{# if(item.company_type==2){ }}
代理商
{{# } }}
{{# if(item.company_type==3){ }}
原厂
{{# } }}
{{# if(item.company_type==4){ }}
制造商
{{# } }}
{{# if(item.company_type==5){ }}
个人用户
{{# } }}
{{# } else { }}
--
{{# } }}
</span>
<div class="fl name ellipsis">{{item.company_name||''}}</div>
</div>
</div>
{{# }); }}
</div>
{{# if(d.length === 0){ }}
<div class="no_data" style="padding:60px 0 60px">
<img src="__PUBLIC__/images/nosearchdata.png" alt="">
<p class="bold">未搜索到相关信息</p>
</div>
{{# } }}
<div class="btn_div">
<a class="btn btn_blue" href="passporticsales/login">登录,查看更多结果</a>
</div>
</script>
</body>
</html>
\ No newline at end of file
\ No newline at end of file
<?php
return array(
'LOAD_EXT_CONFIG' => 'config_url',
);
\ No newline at end of file
<?php
return array(
'URL_ROUTE_RULES' => array(//动态路由
),
'URL_MAP_RULES' => array(//静态路由
'index' => 'Index/index',
'indexsearch' => 'Index/indexsearch',
)
);
<?php
namespace Home\Controller;
use Home\Controller\BaseController;
class IndexController extends BaseController
{
public function _initialize()
{
parent::_initialize();
if (!cookie('token') && ACTION_NAME != 'login' && ACTION_NAME != 'register' && ACTION_NAME != 'index' && ACTION_NAME != 'indexsearch' && ACTION_NAME != 'forget') {
$this->redirect('/login');
}
}
/**
* 首页
*/
public function index()
{
$datas['cooperation_pf'] = $this->apiBaseCache('pc_home_cooperation_pf', '', ''); // 合作平台
foreach ($datas as $k => $v) {
$this->assign($k, $v['data']);
}
$this->display('Index/index');
}
/**
* 首页搜索结果
*/
public function indexsearch()
{
$this->display('Index/search');
}
/**
* 登录页面
*/
public function login()
{
$this->display('Login/index');
}
/**
* 注册页面
*/
public function register()
{
$this->display('Register/index');
}
/**
* 忘记密码
*/
public function forget()
{
$this->display('Forget/index');
}
/**
* 后台管理首页
*/
public function home()
{
$this->display('Home/index');
}
/**
* 我的询价
*/
public function inquiry()
{
$this->display('QuotePrice/inquiry');
}
/**
* 发布询价
*/
public function releaseinquiry()
{
$this->display('QuotePrice/releaseinquiry');
}
/**
* 询价详情
*/
public function inquirydetail()
{
$this->display('QuotePrice/inquirydetail');
}
/**
* 我的报价
*/
public function quote()
{
$this->display('QuotePrice/quote');
}
/**
* 我的报价详情
*/
public function quotedetail()
{
$this->display('QuotePrice/quotedetail');
}
/**
* 抢单专区
*/
public function roborder()
{
$this->display('RobOrder/index');
}
/**
* 商品管理
*/
public function goodmanage()
{
$this->display('GoodManage/index');
}
/**
* 上传单个商品
*/
public function uploadsingle()
{
$this->display('GoodManage/uploadsingle');
}
/**
* 批量上传商品
*/
public function bulkupload()
{
$this->display('GoodManage/bulkupload');
}
/**
* 批量上传结果
*/
public function uploadresult()
{
$this->display('GoodManage/uploadresult');
}
/**
* 商品详情
*/
public function gooddetail()
{
$this->display('GoodManage/gooddetail');
}
/**
* 账户设置
*/
public function account()
{
$this->display('Account/index');
}
/**
* 积分管理
*/
public function integral()
{
$this->display('Integral/index');
}
/**
* 搜索结果
*/
public function search()
{
$this->display('Search/index');
}
/**
* 认证管理
*/
public function certification()
{
$this->display('Certification/index');
}
/**
* 通知
*/
public function notice()
{
$this->display('Notice/index');
}
/**
* 聊天
*/
public function chat()
{
$this->display('Chat/index');
}
}
<?php
/**
* 获取CMS缓存
*/
namespace Home\Model;
class ScmsModel
{
/**
* 获取bcat_id
* @param [type] $key [键]
* @param integer $type [取值类型:1-通过tags,2-通过tem_id(楼层类目)]
* @return [type] [description]
*/
public function getBcatId($key, $type=1)
{
return $type == 1 ? S_cms('icsales:lie_base_cat:tags', $key, 'bcat_id') : S_cms('icsales:lie_base_cat:tem_id:'.$key);
}
/**
* 获取base数据
* @param [type] $key [键]
* @param string $limit [限制数量]
* @param integer $type [取值类型:1-通过bcat_id, 2-通过tem_id,3-通过model_id]
* @return [type] $condition [搜索条件,用&连接,如:a=1&b=2]
* @param [type] $table [表名]
* @return [type] [description]
*/
public function getBase($key, $limit='', $condition='', $type=1, $table='lie_base')
{
if ($type == 1)
$datas = S_cms('icsales:'.$table.':bcat_id:'.$key, '', '', 'sort');
else if ($type == 2)
$datas = S_cms('icsales:'.$table.':tem_id:'.$key, '', '', 'sort');
else
$datas = S_cms('icsales:'.$table.':model_id:'.$key, '', '', 'sort');
if (!$datas) return $datas;
if ($condition) {
parse_str($condition, $arr); // 解析条件,输出数组
$isTrue = true;
$datas = array_filter($datas, function($base) use ($arr, $isTrue) {
foreach ($arr as $k=>$v) {
if (isset($base[$k]) && $base[$k] != $v) { // 判断每个搜索条件是否存在且值相等,若不相等,则过滤对应的datas数组值
$isTrue = false;
}
}
return $isTrue;
});
array_multisort($datas); // 重新索引
}
$datas = $limit ? array_slice($datas, 0, $limit) : $datas;
return $datas;
}
/**
* 获取Base表配置内容
* @param [type] $tags [tags值]
* @param string $where [条件]
* @param string $limit [限制数量]
* @return [type] [description]
*/
public function getBaseList($tags, $where='', $limit=1)
{
$bcat_id = $this->getBcatId($tags); // 分类ID
return $this->getBase($bcat_id, $limit, $where);
}
/**
* 获取楼层模板
* @param [type] $key [键]
* @return [type] [description]
*/
public function getTemplate($key)
{
return S_cms('icsales:lie_template:tag:'.$key, '', '', 'sort');
}
/**
* 获取模块
* @param [type] $field [字段值]
* @param string $column [指定列]
* @return [type] [description]
*/
public function getModel($field, $column='')
{
return $column ? S_cms('icsales:lie_model:model_key', $field, $column) : S_cms('icsales:lie_model:model_key', $field);
}
/**
* 获取导航
* @param integer $model_id [所属模块ID]
* @param integer $parent_id [所属父级ID] <先查找模块下所有导航,遍历后,根据nav_id查找对应子级>
* @return [type] [description]
*/
public function getNavigation($model_id, $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_navigation:model_id:'.$model_id, '', '', 'sort') : S_cms('icsales:lie_navigation:model_id:'.$model_id.':parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取帮助中心分类
* @param integer $model_id [所属模块ID]
* @param integer $parent_id [所属父级ID] <先查找模块下所有分类,遍历后,根据hccat_id查找对应子级>
* @return [type] [description]
*/
public function getHelpCenterCat($model_id, $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_help_center_cat:model_id:'.$model_id, '', '', 'sort') : S_cms('icsales:lie_help_center_cat:model_id:'.$model_id.':parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取帮助中心内容
* @param [type] $hccat_id [帮助中心分类ID]
* @return [type] [description]
*/
public function getHelpCenter($hccat_id)
{
return S_cms('icsales:lie_help_center:hccat_id:'.$hccat_id, '', '', 'sort');
}
/**
* 获取底部链接分类
* @param integer $fcat_key [所属模块ID]
* @param integer $column [指定字段]
* @param integer $parent_id [所属父级ID] <先查找模块下所有分类,遍历后,根据fcat_id查找对应子级>
* @return [type] [description]
*/
public function getFooterLinkCat($fcat_key, $column='', $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_footer_link_cat:fcat_key', $fcat_key, $column, 'sort') : S_cms('icsales:lie_footer_link_cat:parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取底部链接内容
* @param [type] $fcat_id [帮助中心分类ID]
* @return [type] [description]
*/
public function getFooterLink($fcat_id)
{
return S_cms('icsales:lie_footer_link:fcat_id:'.$fcat_id, '', '', 'sort');
}
/**
* 获取页面分类
* @param integer $model_id [所属模块ID]
* @return [type] [description]
*/
public function getPageCat($model_id)
{
return S_cms('icsales:lie_page_cat:model_id:'.$model_id);
}
/**
* 获取页面内容
* @param [type] $pagecat_id [页面分类ID]
* @return [type] [description]
*/
public function getPage($pagecat_id)
{
return S_cms('icsales:lie_page:pagecat_id:'.$pagecat_id);
}
/************************************** 信宏泰配置 **************************************/
/**
* 获取公司
* @return [type] [description]
*/
public function getCompany()
{
return S_cms('icsales:xht:lie_company', '', '', 'sort');
}
/**
* 获取公司信息
* @param [type] $com_id [公司ID]
* @return [type] [description]
*/
public function getCompanyInfo($com_id)
{
return S_cms('icsales:xht:lie_company_info:com_id:'.$com_id, '', '', 'sort');
}
/**
* 获取公司图片
* @param [type] $com_id [公司ID]
* @return [type] [description]
*/
public function getCompanyImg($com_id)
{
return S_cms('icsales:xht:lie_company_img:com_id:'.$com_id, '', '', 'sort');
}
}
\ No newline at end of file
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment