Compare commits
2 Commits
dd80a961ae
...
8b5672a203
| Author | SHA1 | Date |
|---|---|---|
|
|
8b5672a203 | |
|
|
9a771acc77 |
|
|
@ -0,0 +1,16 @@
|
|||
[app]
|
||||
app_debug = true;
|
||||
app_trace = false;
|
||||
|
||||
[database]
|
||||
hostname = like-mysql
|
||||
database = test_likeshop
|
||||
username = root
|
||||
password = roixxx2008fffot
|
||||
hostport = 3306
|
||||
|
||||
|
||||
|
||||
[project]
|
||||
env_name =
|
||||
file_domain = www.likeshopv2.localhost
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/config/install.lock
|
||||
/public/uploads/*
|
||||
!/public/uploads/index.html
|
||||
/runtime/*
|
||||
!/runtime/index.html
|
||||
/.env
|
||||
/public/upgrade/*
|
||||
!/public/upgrade/version.json
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
RewriteBase /
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
|
||||
</IfModule>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
sudo: false
|
||||
|
||||
language: php
|
||||
|
||||
branches:
|
||||
only:
|
||||
- stable
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
before_install:
|
||||
- composer self-update
|
||||
|
||||
install:
|
||||
- composer install --no-dev --no-interaction --ignore-platform-reqs
|
||||
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip .
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-image:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0"
|
||||
- composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0"
|
||||
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip .
|
||||
|
||||
script:
|
||||
- php think unit
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw=
|
||||
file:
|
||||
- ThinkPHP_Core.zip
|
||||
- ThinkPHP_Full.zip
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\admin\logic\{GoodsBrandLogic, GoodsCategoryLogic, GoodsLogic, SupplierLogic,FreightLogic,CommonLogic};
|
||||
use app\admin\logic\{GoodsBrandLogic, GoodsCategoryLogic, GoodsLogic, SupplierLogic,FreightLogic,CommonLogic,ScreenSizeLogic,ScreenMudLogic};
|
||||
use think\Db;
|
||||
|
||||
class Goods extends AdminBase
|
||||
|
|
@ -137,6 +137,8 @@ class Goods extends AdminBase
|
|||
$this->assign('brand_lists',json_encode(GoodsBrandLogic::getGoodsBrandList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('supplier_lists',json_encode(SupplierLogic::getSupplierList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('freight_lists',json_encode(FreightLogic::getFreightList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('mud_lists',json_encode(ScreenMudLogic::getScreenMudList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('size_lists',json_encode(ScreenSizeLogic::getScreenSizeList(),JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
|
@ -229,6 +231,8 @@ class Goods extends AdminBase
|
|||
$this->assign('brand_lists',json_encode(GoodsBrandLogic::getGoodsBrandList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('supplier_lists',json_encode(SupplierLogic::getSupplierList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('freight_lists',json_encode(FreightLogic::getFreightList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('mud_lists',json_encode(ScreenMudLogic::getScreenMudList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('size_lists',json_encode(ScreenSizeLogic::getScreenSizeList(),JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch('goods/add');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ class ShopSetting extends AdminBase
|
|||
'service' => ConfigServer::get('policy', 'service'),
|
||||
'privacy' => ConfigServer::get('policy', 'privacy'),
|
||||
'after_sale' => ConfigServer::get('policy', 'after_sale'),
|
||||
'payment' => ConfigServer::get('policy', 'payment'),
|
||||
'reason' => ConfigServer::get('policy', 'reason'),
|
||||
|
||||
];
|
||||
$this->assign('config', $config);
|
||||
|
|
@ -87,6 +89,8 @@ class ShopSetting extends AdminBase
|
|||
ConfigServer::set('policy', 'service', $post['service']);
|
||||
ConfigServer::set('policy', 'privacy', $post['privacy']);
|
||||
ConfigServer::set('policy', 'after_sale', $post['after_sale']);
|
||||
ConfigServer::set('policy', 'payment', $post['payment']);
|
||||
ConfigServer::set('policy', 'reason', $post['reason']);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,99 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 宏驰云科技开发团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// | Author: HcyShop-kiki
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\{
|
||||
StoreLogic
|
||||
};
|
||||
|
||||
class Store extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 门店列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', StoreLogic::lists($get));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文章
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Store.add');
|
||||
if ($result === true) {
|
||||
StoreLogic::addStore($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑文章
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Store.edit');
|
||||
|
||||
if ($result === true) {
|
||||
StoreLogic::editStore($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$article = StoreLogic::getStore($id);
|
||||
$this->assign('article', $article);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\Store.del');
|
||||
if ($result === true) {
|
||||
StoreLogic::delStore($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
StoreLogic::switchStatus($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ class CommonLogic{
|
|||
public static function changeTableValue($table,$pk_name,$pk_value,$field,$field_value){
|
||||
//允许修改的字段
|
||||
$allow_field = [
|
||||
'is_show','sort','status','is_new','is_best','is_like','is_recommend'
|
||||
'is_show','sort','status','is_new','is_best','is_like','is_recommend','is_jiantreasure','is_zdtreasure'
|
||||
];
|
||||
if(!in_array($field,$allow_field)){
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -247,14 +247,11 @@ class GoodsLogic
|
|||
'name' => $post['name'],
|
||||
'code' => $post['code'],
|
||||
'first_category_id' => $post['first_category_id'],
|
||||
'second_category_id' => $post['second_category_id'],
|
||||
'third_category_id' => $post['third_category_id'],
|
||||
'brand_id' => $post['brand_id'],
|
||||
'supplier_id' => $post['supplier_id'],
|
||||
'image' => $post['image'],
|
||||
'video' => $video,
|
||||
'poster' => $post['poster'] ?? '',
|
||||
'remark' => $post['remark'],
|
||||
'content' => $post['content'],
|
||||
'max_price' => $max_price,
|
||||
'min_price' => $min_price,
|
||||
|
|
@ -267,22 +264,18 @@ class GoodsLogic
|
|||
'free_shipping_type' => $post['free_shipping_type'],
|
||||
'free_shipping' => $free_shipping,
|
||||
'free_shipping_template_id' => $free_shipping_template_id,
|
||||
'is_commission' => $post['is_commission'],
|
||||
'first_ratio' => $post['first_ratio'],
|
||||
'second_ratio' => $post['second_ratio'],
|
||||
'three_ratio' => $post['three_ratio'],
|
||||
'is_new' => isset($post['is_new']) && $post['is_new'] == 'on' ? 1 : 0,
|
||||
'is_best' => isset($post['is_best']) && $post['is_best'] == 'on' ? 1 : 0,
|
||||
'is_like' => isset($post['is_like']) && $post['is_like'] == 'on' ? 1 : 0,
|
||||
// 'is_share_bouns' => $post['is_share_bouns'],
|
||||
// 'region_ratio' => $post['region_ratio'],
|
||||
// 'shareholder_ratio' => $post['shareholder_ratio'],
|
||||
'is_integral' => $post['is_integral'],
|
||||
'is_member' => $post['is_member'],
|
||||
'give_integral_type' => $give_integral_type,
|
||||
'give_integral' => $give_integral,
|
||||
'spec_type' => $post['spec_type'],
|
||||
'create_time' => $time
|
||||
'create_time' => $time,
|
||||
'size_id' => $post['size_id'],
|
||||
'mud_id' => $post['mud_id'],
|
||||
'rongliang_name' => $post['rongliang_name'],
|
||||
'is_jiantreasure' => isset($post['is_jiantreasure']) && $post['is_jiantreasure'] == 'on' ? 1 : 0,
|
||||
'is_zdtreasure' => isset($post['is_zdtreasure']) && $post['is_zdtreasure'] == 'on' ? 1 : 0
|
||||
];
|
||||
$goods_id = Db::name('goods')->insertGetId($data);
|
||||
|
||||
|
|
@ -441,14 +434,11 @@ class GoodsLogic
|
|||
'name' => $post['name'],
|
||||
'code' => $post['code'],
|
||||
'first_category_id' => $post['first_category_id'],
|
||||
'second_category_id' => $post['second_category_id'],
|
||||
'third_category_id' => $post['third_category_id'],
|
||||
'brand_id' => $post['brand_id'],
|
||||
'supplier_id' => $post['supplier_id'],
|
||||
'image' => $post['image'],
|
||||
'video' => $video,
|
||||
'poster' => $post['poster'] ?? '',
|
||||
'remark' => $post['remark'],
|
||||
'content' => $post['content'],
|
||||
'max_price' => $max_price,
|
||||
'min_price' => $min_price,
|
||||
|
|
@ -461,22 +451,18 @@ class GoodsLogic
|
|||
'free_shipping_type' => $post['free_shipping_type'],
|
||||
'free_shipping' => $free_shipping,
|
||||
'free_shipping_template_id' => $free_shipping_template_id,
|
||||
'is_commission' => $post['is_commission'],
|
||||
'first_ratio' => $post['first_ratio'],
|
||||
'second_ratio' => $post['second_ratio'],
|
||||
'three_ratio' => $post['three_ratio'],
|
||||
'is_new' => isset($post['is_new']) && $post['is_new'] == 'on' ? 1 : 0,
|
||||
'is_best' => isset($post['is_best']) && $post['is_best'] == 'on' ? 1 : 0,
|
||||
'is_like' => isset($post['is_like']) && $post['is_like'] == 'on' ? 1 : 0,
|
||||
// 'is_share_bouns' => $post['is_share_bouns'],
|
||||
// 'region_ratio' => $post['region_ratio'],
|
||||
// 'shareholder_ratio' => $post['shareholder_ratio'],
|
||||
'is_integral' => $post['is_integral'],
|
||||
'is_member' => $post['is_member'],
|
||||
'give_integral_type' => $give_integral_type,
|
||||
'give_integral' => $give_integral,
|
||||
'spec_type' => $post['spec_type'],
|
||||
'update_time' => $time
|
||||
'update_time' => $time,
|
||||
'size_id' => $post['size_id'],
|
||||
'mud_id' => $post['mud_id'],
|
||||
'rongliang_name' => $post['rongliang_name'],
|
||||
'is_jiantreasure' => isset($post['is_jiantreasure']) && $post['is_jiantreasure'] == 'on' ? 1 : 0,
|
||||
'is_zdtreasure' => isset($post['is_zdtreasure']) && $post['is_zdtreasure'] == 'on' ? 1 : 0
|
||||
];
|
||||
|
||||
Db::name('goods')
|
||||
|
|
@ -783,18 +769,9 @@ class GoodsLogic
|
|||
*/
|
||||
public static function getCateName($cates, $item)
|
||||
{
|
||||
if(isset($cates[$item['third_category_id']])) {
|
||||
return $cates[$item['third_category_id']];
|
||||
}
|
||||
|
||||
if(isset($cates[$item['second_category_id']])) {
|
||||
return $cates[$item['second_category_id']];
|
||||
}
|
||||
|
||||
if(isset($cates[$item['first_category_id']])) {
|
||||
return $cates[$item['first_category_id']];
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
|
@ -107,4 +107,9 @@ class ScreenCapacityLogic
|
|||
];
|
||||
return Db::name('screen_capacity')->where(['del' => 0, 'id' => $post['id']])->update($data);
|
||||
}
|
||||
|
||||
//获取容量列表
|
||||
public static function getScreenCapacityList(){
|
||||
return Db::name('screen_capacity')->where(['del'=>0])->field('id,name')->select();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,4 +103,9 @@ class ScreenMudLogic
|
|||
];
|
||||
return Db::name('screen_mud')->where(['del' => 0, 'id' => $post['id']])->update($data);
|
||||
}
|
||||
|
||||
//获取泥料列表
|
||||
public static function getScreenMudList(){
|
||||
return Db::name('screen_mud')->where(['del'=>0])->field('id,name')->select();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,4 +103,9 @@ class ScreenSizeLogic
|
|||
];
|
||||
return Db::name('screen_size')->where(['del' => 0, 'id' => $post['id']])->update($data);
|
||||
}
|
||||
|
||||
//获取尺寸列表
|
||||
public static function getScreenSizeList(){
|
||||
return Db::name('screen_size')->where(['del'=>0])->field('id,name')->select();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,104 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 宏驰云科技开发团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// | Author: HcyShop-kiki
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\logic;
|
||||
|
||||
use app\admin\model\Store;
|
||||
use app\common\server\UrlServer;
|
||||
use think\Db;
|
||||
|
||||
class StoreLogic
|
||||
{
|
||||
|
||||
public static function lists($get)
|
||||
{
|
||||
$store = Db::name('store');
|
||||
|
||||
$where = [];
|
||||
$where[] = ['del', '=', '0'];
|
||||
|
||||
if (isset($get['title']) && $get['title']) {
|
||||
$where[] = ['title|address|image|business', 'like', '%' . $get['title'] . '%'];
|
||||
}
|
||||
$count = $store->where($where)->count();
|
||||
$list = $store->where($where)->page($get['page'], $get['limit'])->order('id desc')->select();
|
||||
foreach ($list as &$item) {
|
||||
$item['image'] = UrlServer::getFileUrl($item['image']);
|
||||
$item['create_time'] = date('Y-m-d H:i:s', $item['create_time']);
|
||||
if ($item['is_show'] == 1) {
|
||||
$item['is_show_text'] = '显示';
|
||||
} else {
|
||||
$item['is_show_text'] = '隐藏';
|
||||
}
|
||||
}
|
||||
return ['count' => $count, 'lists' => $list];
|
||||
}
|
||||
|
||||
|
||||
public static function addStore($post)
|
||||
{
|
||||
$store = new Store();
|
||||
|
||||
$data = [
|
||||
'title' => $post['title'],
|
||||
'address' => $post['address'],
|
||||
'image' => $post['image'],
|
||||
'business' => $post['business'],
|
||||
'is_show' => $post['is_show'],
|
||||
'traffic' => $post['traffic'],
|
||||
'create_time' => time(),
|
||||
'contact' => $post['contact'],
|
||||
];
|
||||
return $store->save($data);
|
||||
}
|
||||
|
||||
public static function editStore($post)
|
||||
{
|
||||
$store = new Store();
|
||||
$data = [
|
||||
'title' => $post['title'],
|
||||
'address' => $post['address'],
|
||||
'image' => $post['image'],
|
||||
'business' => $post['business'],
|
||||
'is_show' => $post['is_show'],
|
||||
'traffic' => $post['traffic'],
|
||||
'update_time' => time(),
|
||||
'contact' => $post['contact'],
|
||||
];
|
||||
return $store->save($data, ['id' => $post['id'], 'del' => 0]);
|
||||
}
|
||||
|
||||
public static function getStore($id)
|
||||
{
|
||||
$store = new Store();
|
||||
$detail = $store::get(['id' => $id, 'del' => 0]);
|
||||
$detail['abs_image'] = UrlServer::getFileUrl($detail['image']);
|
||||
return $detail;
|
||||
}
|
||||
|
||||
public static function delStore($id)
|
||||
{
|
||||
$store = new Store();
|
||||
|
||||
$data = [
|
||||
'del' => time(),
|
||||
'update_time' => 1
|
||||
];
|
||||
return $article->save($data, ['id' => $id, 'del' => 0]);
|
||||
}
|
||||
|
||||
public static function switchStatus($post)
|
||||
{
|
||||
$data = [
|
||||
'is_show' => $post['is_show'],
|
||||
'update_time' => time(),
|
||||
];
|
||||
return Db::name('store')->where(['del' => 0, 'id' => $post['id']])->update($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -50,6 +50,8 @@ class SupplierLogic{
|
|||
'cid' => $post['cid'],
|
||||
'remark' => $post['remark'],
|
||||
'honor' => $post['honor'],
|
||||
'is_notice' => $post['is_notice'],
|
||||
'position' => $post['position'],
|
||||
'create_time' => time(),
|
||||
];
|
||||
|
||||
|
|
@ -68,6 +70,8 @@ class SupplierLogic{
|
|||
'cid' => $post['cid'],
|
||||
'remark' => $post['remark'],
|
||||
'honor' => $post['honor'],
|
||||
'is_notice' => $post['is_notice'],
|
||||
'position' => $post['position'],
|
||||
'update_time' => time(),
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 宏驰云科技开发团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// | Author: HcyShop-kiki
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\model;
|
||||
use think\Model;
|
||||
|
||||
class Store extends Model {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 宏驰云科技开发团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// | Author: HcyShop-kiki
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Store extends Validate
|
||||
{
|
||||
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'title' => 'require|unique:article,title^del',
|
||||
'address' => 'require',
|
||||
'image' => 'require',
|
||||
'business' => 'require',
|
||||
'traffic' => 'require',
|
||||
'contact' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => 'id不可为空',
|
||||
'title.require' => '请输入门店名称',
|
||||
'title.unique' => '标题不能重复!',
|
||||
|
||||
'address.require' => '请输入门店地址',
|
||||
'image.require' => '请商城门店图片',
|
||||
'business.require' => '请输入门店营业时间',
|
||||
'traffic.require' => '请输入门店交通情况',
|
||||
'contact.require' => '请输入门店联系方式',
|
||||
];
|
||||
|
||||
protected function sceneAdd()
|
||||
{
|
||||
$this->remove('id');
|
||||
|
||||
}
|
||||
|
||||
protected function sceneEdit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function sceneDel()
|
||||
{
|
||||
$this->only(['id']);
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
<li class="goods-tab" style="color: #6a6f6c">价格库存</li>
|
||||
<li class="goods-tab" style="color: #6a6f6c">商品详情</li>
|
||||
<li class="goods-tab" style="color: #6a6f6c">销售设置</li>
|
||||
<li class="goods-tab" style="color: #6a6f6c">分销设置</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content layui-form">
|
||||
<div class="layui-tab-item goods-content layui-show">
|
||||
|
|
@ -22,12 +21,6 @@
|
|||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商品编码:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="code" lay-verType="tips" autocomplete="off" switch-tab="0" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="form-label-asterisk">*</span>商品分类:</label>
|
||||
<div class="layui-input-inline">
|
||||
|
|
@ -36,21 +29,11 @@
|
|||
<option value="">请选择分类</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<select name="second_category_id" lay-filter="second_category">
|
||||
<option value="">请选择分类</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<select name="third_category_id" lay-filter="third_category">
|
||||
<option value="">请选择分类</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商品卖点:</label>
|
||||
<label class="layui-form-label"><span class="form-label-asterisk">*</span>商品编码:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" maxlength="32" name="remark" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="code" lay-verType="tips" autocomplete="off" switch-tab="0" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-bottom: 0px">
|
||||
|
|
@ -75,42 +58,44 @@
|
|||
<div class="layui-form-item"><label class="layui-form-label"></label><span
|
||||
style="color: #a3a3a3;font-size: 9px">建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传8张</span></div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商品视频:</label>
|
||||
<div class="upload-file-div video-style" id="video">
|
||||
<a href="#" class="upload-file-title">+添加视频</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item"><label class="layui-form-label"></label><span
|
||||
style="color: #a3a3a3;font-size: 9px">手机端播放,建议时长9-30秒,建议视频宽高比16:9</span></div>
|
||||
|
||||
<div class="layui-form-item" style="margin-bottom: 0px">
|
||||
<label class="layui-form-label">自定义分享海报:</label>
|
||||
<div style="height:80px;line-height:80px">
|
||||
<div class="poster-image" ></div>
|
||||
<div class="goods-img-add poster-upload" lay-verify="image" lay-verType="tips" switch-tab="0" verify-msg="选择图片"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item"><label class="layui-form-label"></label><span
|
||||
style="color: #a3a3a3;font-size: 9px">自定义商品分享的海报图,留空则默认使用商品封面图,建议尺寸:800*800像素</span></div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商品品牌:</label>
|
||||
<label class="layui-form-label"><span class="form-label-asterisk">*</span>壶类型:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="brand_id" lay-verType="tips" switch-tab="0" verify-msg="请选择商品品牌">
|
||||
<option value="">请选择品牌</option>
|
||||
<select name="brand_id" lay-verType="tips" switch-tab="0" verify-msg="请选择壶类型">
|
||||
<option value="">请选择壶类型</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">供货商:</label>
|
||||
<label class="layui-form-label"><span class="form-label-asterisk">*</span>专家:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="supplier_id" lay-verType="tips" switch-tab="0" verify-msg="请选择供货商">
|
||||
<option value="">请选择供货商</option>
|
||||
<select name="supplier_id" lay-verType="tips" switch-tab="0" verify-msg="请选择专家">
|
||||
<option value="">请选择专家</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="form-label-asterisk">*</span>尺寸:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="size_id" lay-verType="tips" switch-tab="0" verify-msg="请选择尺寸">
|
||||
<option value="">请选择尺寸</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="form-label-asterisk">*</span>泥料:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="mud_id" lay-verType="tips" switch-tab="0" verify-msg="请选择泥料">
|
||||
<option value="">请选择泥料</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="form-label-asterisk">*</span>容量:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="rongliang_name" lay-verType="tips" autocomplete="off" switch-tab="0" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -275,64 +260,14 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<!--积分抵扣-start-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">积分抵扣:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="is_integral" value="1" title="允许积分抵扣" >
|
||||
<input type="radio" name="is_integral" value="0" title="不能使用积分抵扣" checked>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"></label>
|
||||
<span style="color: #a3a3a3;font-size: 9px">默认不参与积分抵扣</span>
|
||||
</div>
|
||||
<!--积分抵扣-end-->
|
||||
<!--赠送积分-start-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">赠送积分:</label>
|
||||
<div class="layui-input-inline" style="margin-right: 0px;width: auto">
|
||||
<input type="radio" name="give_integral_type" value="1" title="赠送固定积分">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="give_integral_num" class="layui-input time" autocomplete="off">
|
||||
</div>
|
||||
<div class="unit-tips">积分</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"></label>
|
||||
<div class="layui-input-inline" style="margin-right: 0px;width: auto">
|
||||
<input type="radio" name="give_integral_type" value="2" title="按比例赠送积分">
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width:auto">
|
||||
<input type="number" min="0" name="give_integral_ratio" class="layui-input">
|
||||
</div>
|
||||
<div class="unit-tips">%</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"></label>
|
||||
<span style="color: #a3a3a3;font-size: 9px">按商品金额的比例赠送积分</span>
|
||||
</div>
|
||||
<!--赠送积分-end-->
|
||||
<!--会员价-start-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">会员价:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="is_member" value="0" title="不参与会员价" checked>
|
||||
<input type="radio" name="is_member" value="1" title="根据会员等级折扣计算会员价" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"></label>
|
||||
<span style="color: #a3a3a3;font-size: 9px">根据会员等级设置的会员折扣自动打折,拼团和秒杀等营销活动不参与会员折扣</span>
|
||||
</div>
|
||||
<!--会员价-end-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商品标签:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="checkbox" name="is_new" lay-skin="primary" title="新品推荐">
|
||||
<input type="checkbox" name="is_best" lay-skin="primary" title="好物优选">
|
||||
<input type="checkbox" name="is_like" lay-skin="primary" title="猜你喜欢">
|
||||
<input type="checkbox" name="is_new" lay-skin="primary" title="新品上架">
|
||||
<input type="checkbox" name="is_best" lay-skin="primary" title="精品推荐">
|
||||
<input type="checkbox" name="is_like" lay-skin="primary" title="今日促销">
|
||||
<input type="checkbox" name="is_jiantreasure" lay-skin="primary" title="藏品捡宝">
|
||||
<input type="checkbox" name="is_zdtreasure" lay-skin="primary" title="镇店藏品">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
|
|
@ -343,35 +278,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-tab-item">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分销佣金:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="is_commission" value="1" title="开启" checked>
|
||||
<input type="radio" name="is_commission" value="0" title="不开启" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item"><label class="layui-form-label"></label><span
|
||||
style="color: #a3a3a3;font-size: 9px">开启后商品可以参与分销佣金</span></div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">一级分销比例:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="first_ratio" autocomplete="off" class="layui-input first_ratio">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">二级分销比例:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="second_ratio" autocomplete="off" class="layui-input second_ratio">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">三级分销比例:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="three_ratio" lay-verify="distribution" autocomplete="off" class="layui-input three_ratio">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="goods-submit" id="goods-submit" value="确认">
|
||||
</div>
|
||||
|
|
@ -505,23 +411,6 @@
|
|||
format(that,value)
|
||||
|
||||
});
|
||||
//格式化分销比例
|
||||
function format(that,value){
|
||||
value = value.replace(/[^0-9.]/g,'');
|
||||
|
||||
value = value.replace(/\.{2,}/g,".");
|
||||
value = value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
|
||||
|
||||
value = value.replace(/^(\-)*(\d+)\.(\d)(\d).*$/,'$1$2.$3$4');
|
||||
if(value.indexOf(".")< 0 && value !=""){
|
||||
value= parseFloat(value);
|
||||
}
|
||||
if(value > 100){
|
||||
that.val(100);
|
||||
return false;
|
||||
}
|
||||
that.val(value);
|
||||
}
|
||||
|
||||
|
||||
//------------------------基本信息----------------------------------
|
||||
|
|
@ -548,18 +437,6 @@
|
|||
like.showImg(src,600);
|
||||
});
|
||||
|
||||
//分享海报删除按钮
|
||||
$(document).on('mouseenter','.poster-image',function () {
|
||||
|
||||
$(this).children('.goods-image-del').show();
|
||||
})
|
||||
$(document).on('mouseleave', '.poster-image', function () {
|
||||
$(this).children('.goods-image-del').hide();
|
||||
});
|
||||
$(document).on('click', '.poster-image', function () {
|
||||
var src = $(this).children('img').attr('src');
|
||||
like.showImg(src,600);
|
||||
});
|
||||
|
||||
$(document).on('click', '.goods-img-del-x', function () {
|
||||
|
||||
|
|
@ -614,20 +491,6 @@
|
|||
}
|
||||
}, true);
|
||||
|
||||
// ========= 视频上传 开始
|
||||
$('#video').click(function(){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '上传视频',
|
||||
content: '{:url("file_new/lists")}?type=video',
|
||||
area: ['90%', '90%']
|
||||
});
|
||||
});
|
||||
|
||||
window.videoCallback = function(uris) {
|
||||
like.videoCallback(uris);
|
||||
};
|
||||
// ========== 视频上传 结束
|
||||
|
||||
//图片拉拽
|
||||
$(document).on('dragstart', '.goods-li', function (e) {
|
||||
|
|
@ -654,12 +517,12 @@
|
|||
swop($(this), $(this).parent().children().eq(swop_element));
|
||||
});
|
||||
|
||||
//渲染品牌
|
||||
//渲染壶类型
|
||||
var brands = {$brand_lists | raw};
|
||||
|
||||
setBrand();
|
||||
function setBrand(default_id) {
|
||||
var brand_select_html = '<option value="">请选择品牌</option>';
|
||||
var brand_select_html = '<option value="">请选择壶类型</option>';
|
||||
for (var i in brands) {
|
||||
brand_select_html += '<option value="' + brands[i]['id'] + '">' + brands[i]['name'] + '</option>';
|
||||
}
|
||||
|
|
@ -668,11 +531,11 @@
|
|||
form.render('select');
|
||||
}
|
||||
|
||||
//渲染供应商
|
||||
//渲染专家
|
||||
var supplier = {$supplier_lists | raw};
|
||||
setSupplier();
|
||||
function setSupplier(default_id) {
|
||||
var supplier_select_html = '<option value="">请选择供应商</option>';
|
||||
var supplier_select_html = '<option value="">请选择专家</option>';
|
||||
for (var i in supplier) {
|
||||
supplier_select_html += '<option value="' + supplier[i]['id'] + '">' + supplier[i]['name'] + '</option>';
|
||||
}
|
||||
|
|
@ -680,6 +543,35 @@
|
|||
$('select[name="supplier_id"]').val(default_id);
|
||||
form.render('select');
|
||||
}
|
||||
|
||||
//渲染尺寸
|
||||
var sizes = {$size_lists | raw};
|
||||
|
||||
setSizes();
|
||||
function setSizes(default_id) {
|
||||
var sizes_select_html = '<option value="">请选择尺寸</option>';
|
||||
for (var i in sizes) {
|
||||
sizes_select_html += '<option value="' + sizes[i]['id'] + '">' + sizes[i]['name'] + '</option>';
|
||||
}
|
||||
$('select[name="size_id"]').html(sizes_select_html);
|
||||
$('select[name="size_id"]').val(default_id);
|
||||
form.render('select');
|
||||
}
|
||||
|
||||
//渲染泥料
|
||||
var muds = {$mud_lists | raw};
|
||||
|
||||
setMuds();
|
||||
function setMuds(default_id) {
|
||||
var muds_select_html = '<option value="">请选择泥料</option>';
|
||||
for (var i in muds) {
|
||||
muds_select_html += '<option value="' + muds[i]['id'] + '">' + muds[i]['name'] + '</option>';
|
||||
}
|
||||
$('select[name="mud_id"]').html(muds_select_html);
|
||||
$('select[name="mud_id"]').val(default_id);
|
||||
form.render('select');
|
||||
}
|
||||
|
||||
//渲染运费模板
|
||||
var freight_template = {$freight_lists | raw};
|
||||
setFreightTemplate();
|
||||
|
|
@ -700,7 +592,6 @@
|
|||
|
||||
setSelectFirst();
|
||||
|
||||
|
||||
function setSelectFirst(default_id) {
|
||||
var category_select_html = '<option value="">请选择分类</option>';
|
||||
for (var i in categorys) {
|
||||
|
|
@ -712,41 +603,6 @@
|
|||
$('select[name="first_category_id"]').val(default_id);
|
||||
form.render('select');
|
||||
}
|
||||
function setSelectSecond(default_id, pid) {
|
||||
pid = pid === undefined ? $('select[name="first_category_id"]').val() : pid;
|
||||
$('select[name="second_category_id"]').html('<option value="">请选择分类</option>');
|
||||
$('select[name="third_category_id"]').html('<option value="">请选择分类</option>');
|
||||
var category_select_html = '<option value="">请选择分类</option>';
|
||||
for (var i in categorys) {
|
||||
if (categorys[i]['pid'] == pid) {
|
||||
category_select_html += '<option value="' + categorys[i]['id'] + '">' + categorys[i]['name'] + '</option>';
|
||||
}
|
||||
}
|
||||
$('select[name="second_category_id"]').html(category_select_html);
|
||||
$('select[name="second_category_id"]').val(default_id);
|
||||
form.render('select');
|
||||
}
|
||||
function setSelectThird(default_id, pid) {
|
||||
pid = pid === undefined ? $('select[name="second_category_id"]').val() : pid;
|
||||
$('select[name="third_category_id"]').html('<option value="">请选择分类</option>');
|
||||
var first_category_id = $('select[name="first_category_id"]').val();
|
||||
var category_select_html = '<option value="">请选择分类</option>';
|
||||
for (var i in categorys) {
|
||||
if (categorys[i]['pid'] == pid) {
|
||||
category_select_html += '<option value="' + categorys[i]['id'] + '">' + categorys[i]['name'] + '</option>';
|
||||
}
|
||||
}
|
||||
$('select[name="third_category_id"]').html(category_select_html);
|
||||
$('select[name="third_category_id"]').val(default_id);
|
||||
form.render('select');
|
||||
}
|
||||
|
||||
form.on('select(first_category)', function (data) {
|
||||
setSelectSecond('', data.value);
|
||||
});
|
||||
form.on('select(second_category)', function (data) {
|
||||
setSelectThird('', data.value);
|
||||
});
|
||||
|
||||
|
||||
//------------------------价格库存----------------------------------
|
||||
|
|
@ -1219,14 +1075,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
// one_market_price: function (value, item) {
|
||||
// if ($('input[name="spec_type"]:checked').val() == 1) {
|
||||
// if (value && value < 0.01) {
|
||||
// switchTab($(item).attr('switch-tab'));
|
||||
// return '市场价必须大于或等于0.01';
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
one_price: function (value, item) {
|
||||
if ($('input[name="spec_type"]:checked').val() == 2) {
|
||||
if (value && value < 0.01) {
|
||||
|
|
@ -1259,14 +1107,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
// more_market_price:function (value, item) {
|
||||
// if ($('input[name="spec_type"]:checked').val() == 2) {
|
||||
// if (value && value < 0.01) {
|
||||
// switchTab($(item).attr('switch-tab'));
|
||||
// return '市场价必须大于或等于0.01';
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
more_stock: function (value, item) {
|
||||
if ($('input[name="spec_type"]:checked').val() == 2) {
|
||||
if (value && value < 0) {
|
||||
|
|
@ -1314,15 +1154,6 @@
|
|||
return '同一规格中,规格值不能重复';
|
||||
}
|
||||
}
|
||||
},
|
||||
distribution:function (value,item) {
|
||||
var first_ratio = parseFloat($('.first_ratio').val());
|
||||
var second_ratio = parseFloat($('.second_ratio').val());
|
||||
var three_ratio = parseFloat(value);
|
||||
if(first_ratio + second_ratio + three_ratio > 100){
|
||||
return '分销比例不可超过100';
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
//------------------------数据验证----------------------------------
|
||||
|
|
@ -1335,12 +1166,13 @@
|
|||
$('input[name="goods_id"]').val(goods_info['base']['id']);
|
||||
$('input[name="name"]').val(goods_info['base']['name']);
|
||||
$('input[name="code"]').val(goods_info['base']['code']);
|
||||
$('input[name="rongliang_name"]').val(goods_info['base']['rongliang_name']);
|
||||
|
||||
setSelectFirst(goods_info['base']['first_category_id']);
|
||||
setSelectSecond(goods_info['base']['second_category_id']);
|
||||
setSelectThird(goods_info['base']['third_category_id']);
|
||||
setBrand(goods_info['base']['brand_id']); //渲染品牌
|
||||
setSupplier(goods_info['base']['supplier_id']); //渲染品供应商
|
||||
setBrand(goods_info['base']['brand_id']); //渲染壶类型
|
||||
setSupplier(goods_info['base']['supplier_id']); //渲染专家
|
||||
setSizes(goods_info['base']['size_id']); //渲染尺寸
|
||||
setMuds(goods_info['base']['mud_id']); //渲染泥料
|
||||
setFreightTemplate(goods_info['base']['free_shipping_template_id']); //渲染运费模板
|
||||
$('input[name="remark"]').val(goods_info['base']['remark']);
|
||||
|
||||
|
|
@ -1385,22 +1217,7 @@
|
|||
$("input[name=free_shipping_type][value="+goods_info['base']['free_shipping_type']+"]").prop("checked",true); //快递运费类型
|
||||
$('input[name="free_shipping"]').val(goods_info['base']['free_shipping']); //运费
|
||||
|
||||
$("input[name=is_commission][value="+goods_info['base']['is_commission']+"]").prop("checked",true); //分销设置
|
||||
$("input[name=is_share_bouns][value="+goods_info['base']['is_share_bouns']+"]").prop("checked",true); //区域股东分红
|
||||
$('input[name="first_ratio"]').val(goods_info['base']['first_ratio']); //一级分销
|
||||
$('input[name="second_ratio"]').val(goods_info['base']['second_ratio']); //二级分销
|
||||
$('input[name="three_ratio"]').val(goods_info['base']['three_ratio']); //三级分销
|
||||
$('input[name="region_ratio"]').val(goods_info['base']['region_ratio']); //区域股东分红
|
||||
$('input[name="shareholder_ratio"]').val(goods_info['base']['shareholder_ratio']); //股东分红
|
||||
|
||||
$("input[name=is_integral][value="+goods_info['base']['is_integral']+"]").prop("checked",true); //积分抵扣
|
||||
$("input[name=is_member][value="+goods_info['base']['is_member']+"]").prop("checked",true); //会员价是否开启
|
||||
$("input[name=give_integral_type][value="+goods_info['base']['give_integral_type']+"]").prop("checked",true); //赠送积分类型
|
||||
if(1 === goods_info['base']['give_integral_type']){
|
||||
$("input[name=give_integral_num]").val(goods_info['base']['give_integral']); //赠送积分
|
||||
}else if(2 === goods_info['base']['give_integral_type']){
|
||||
$("input[name=give_integral_ratio]").val(goods_info['base']['give_integral']);
|
||||
}
|
||||
|
||||
|
||||
//渲染商品标签
|
||||
|
|
@ -1413,6 +1230,12 @@
|
|||
if(1 == goods_info['base']['is_like']){
|
||||
$("input[name=is_like]").prop("checked",true);
|
||||
}
|
||||
if(1 == goods_info['base']['is_jiantreasure']){
|
||||
$("input[name=is_jiantreasure]").prop("checked",true);
|
||||
}
|
||||
if(1 == goods_info['base']['is_zdtreasure']){
|
||||
$("input[name=is_zdtreasure]").prop("checked",true);
|
||||
}
|
||||
|
||||
form.render();
|
||||
switchSpecType(goods_info['base']['spec_type']);
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">商品供货商:</label>
|
||||
<label class="layui-form-label">专家:</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="supplier_id" id="supplier_id" placeholder="请选择商品供货商" >
|
||||
<select name="supplier_id" id="supplier_id" placeholder="请选择专家" >
|
||||
<option value="0">全部</option>
|
||||
{foreach $supplier_list as $val }
|
||||
<option value="{$val.id}">{$val.name}</option>
|
||||
|
|
@ -73,13 +73,6 @@
|
|||
<button id="upper" class="layui-btn layui-btn-sm layuiadmin-btn-goods {$view_theme_color}" data-type="upper" style="display: none;">上架</button>
|
||||
</div>
|
||||
<table id="goods-lists" lay-filter="goods-lists"></table>
|
||||
<script type="text/html" id="ratio">
|
||||
<p >一级佣金:{{d.first_ratio_desc}}</p>
|
||||
<p >二级佣金:{{d.second_ratio_desc}}</p>
|
||||
<p >三级佣金:{{d.three_ratio_desc}}</p>
|
||||
<!-- <p >股东分红比例:{{d.region_ratio_desc}}</p>-->
|
||||
<!-- <p >区域分红比例:{{d.shareholder_ratio_desc}}</p>-->
|
||||
</script>
|
||||
<script type="text/html" id="new">
|
||||
<input type="checkbox" lay-filter="switch-status" data-id={{d.id}} data-field='is_new' lay-skin="switch"
|
||||
lay-text="是|否" {{# if(d.is_new){ }} checked {{# } }} />
|
||||
|
|
@ -92,6 +85,14 @@
|
|||
<input type="checkbox" lay-filter="switch-status" data-id={{d.id}} data-field='is_like' lay-skin="switch"
|
||||
lay-text="是|否" {{# if(d.is_like){ }} checked {{# } }} />
|
||||
</script>
|
||||
<script type="text/html" id="jiantreasure">
|
||||
<input type="checkbox" lay-filter="switch-status" data-id={{d.id}} data-field='is_jiantreasure' lay-skin="switch"
|
||||
lay-text="是|否" {{# if(d.is_jiantreasure){ }} checked {{# } }} />
|
||||
</script>
|
||||
<script type="text/html" id="zdtreasure">
|
||||
<input type="checkbox" lay-filter="switch-status" data-id={{d.id}} data-field='is_zdtreasure' lay-skin="switch"
|
||||
lay-text="是|否" {{# if(d.is_zdtreasure){ }} checked {{# } }} />
|
||||
</script>
|
||||
<script type="text/html" id="goods-info">
|
||||
<img src="{{d.image}}" style="height:60px;width: 60px;margin-right: 5px;" class="image-show"> {{d.name}}
|
||||
</script>
|
||||
|
|
@ -491,14 +492,14 @@
|
|||
{type: 'checkbox'}
|
||||
,{field: 'name', title: '商品名称',width:320,toolbar: '#goods-info'}
|
||||
,{field: 'cat_name',width:160, title: '商品分类'}
|
||||
,{field: 'commission_status',width:160, title: '三级分销'}
|
||||
,{field: 'ratio',width:160, title: '分销比例',toolbar: '#ratio'}
|
||||
,{field: 'price',width:180,title: '价格'}
|
||||
,{field: 'stock',width: 100,title: '总库存'}
|
||||
,{field: 'total_sales_sum',width: 100,title: '总销量'}
|
||||
,{field: 'ratio',width:160, title: '新品推荐',toolbar: '#new'}
|
||||
,{field: 'ratio',width:160, title: '好物优选',toolbar: '#best'}
|
||||
,{field: 'ratio',width:160, title: '猜你喜欢',toolbar: '#like'}
|
||||
,{field: 'ratio',width:160, title: '新品上架',toolbar: '#new'}
|
||||
,{field: 'ratio',width:160, title: '精品推荐',toolbar: '#best'}
|
||||
,{field: 'ratio',width:160, title: '今日促销',toolbar: '#like'}
|
||||
,{field: 'ratio',width:160, title: '藏品捡宝',toolbar: '#jiantreasure'}
|
||||
,{field: 'ratio',width:160, title: '镇店藏品',toolbar: '#zdtreasure'}
|
||||
,{field: 'sort',width: 80, title:'排序',event: 'tips',edit:'text',sort: true}
|
||||
,{field: 'create_time_desc',width:160, title:'发布时间'}
|
||||
,{fixed: 'right', title: '操作', align: 'center', width:300, toolbar: '#goods-operation'}
|
||||
|
|
|
|||
|
|
@ -45,17 +45,7 @@
|
|||
<input type="text" name="name" lay-verify="required" lay-verType="tips" placeholder="请输入名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">父级分类:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="pid" lay-verify="required" placeholder="请选择父级分类" lay-filter="search_pid">
|
||||
<option value="0" data-level="1">顶级分类</option>
|
||||
{foreach $category_list as $item => $val}
|
||||
<option value="{$item}" data-level={$val.level}>{$val.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" value="0" name="pid">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分类图标:</label>
|
||||
<div class="layui-input-inline">
|
||||
|
|
@ -75,16 +65,12 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item is_recommend">
|
||||
<label class="layui-form-label">首页推荐:</label>
|
||||
<label class="layui-form-label">惠藏百件:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="is_recommend" value="1" title="推荐" checked>
|
||||
<input type="radio" name="is_recommend" value="0" title="不推荐">
|
||||
<input type="radio" name="is_recommend" value="1" title="是" checked>
|
||||
<input type="radio" name="is_recommend" value="0" title="否">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item is_recommend">
|
||||
<label class="layui-form-label"></label>
|
||||
<span style="color: #a3a3a3;font-size: 9px">当前分类推荐在PC商城首页显示,默认推荐</span>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">显示状态:</label>
|
||||
<div class="layui-input-inline">
|
||||
|
|
|
|||
|
|
@ -40,23 +40,13 @@
|
|||
</style>
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-category" id="layuiadmin-form-category" style="padding: 20px 30px 0 0;">
|
||||
<input type="hidden" value="{$info.id}" name="id">
|
||||
<input type="hidden" value="0" name="pid">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">名称:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" value="{$info.name}" lay-verify="required" lay-verType="tips" placeholder="请输入名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">父级分类:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="pid" lay-verify="required" placeholder="请选择父级分类" lay-filter="search_pid">
|
||||
<option value="0" data-level="1">顶级分类</option>
|
||||
{foreach $category_list as $item => $val}
|
||||
<option value="{$item}"data-level={$val.level}{if $info.pid == $item} selected="selected" {/if}>{$val.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分类图标:</label>
|
||||
<div class="layui-input-inline">
|
||||
|
|
@ -83,10 +73,10 @@
|
|||
</div>
|
||||
{if condition="$info['pid'] eq 0" }
|
||||
<div class="layui-form-item is_recommend">
|
||||
<label class="layui-form-label">首页推荐:</label>
|
||||
<label class="layui-form-label">惠藏百件:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="is_recommend" value="1" title="推荐" {if condition="$info['is_recommend'] eq 1" }checked{/if}>
|
||||
<input type="radio" name="is_recommend" value="0" title="不推荐" {if condition="$info['is_recommend'] eq 0" }checked{/if}>
|
||||
<input type="radio" name="is_recommend" value="1" title="是" {if condition="$info['is_recommend'] eq 1" }checked{/if}>
|
||||
<input type="radio" name="is_recommend" value="0" title="否" {if condition="$info['is_recommend'] eq 0" }checked{/if}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item is_recommend">
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
<div class="layui-btn-container" style="display: inline-block;">
|
||||
<div class="layui-btn-group">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-goods_category {$view_theme_color}" id="goods_category-add">添加</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-goods_category {$view_theme_color}" id="expand-all">全部展开</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-goods_category {$view_theme_color}" id="fold-all">全部折叠</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" id="search-value" placeholder="请输入" autocomplete="off" class="layui-input" style="display: inline-block;width: 140px;padding: 0 5px;margin-right: 5px;">
|
||||
|
|
@ -38,9 +36,9 @@
|
|||
</script>
|
||||
<script type="text/html" id="is_recommend">
|
||||
{{# if(d.is_recommend == 1){ }}
|
||||
推荐
|
||||
是
|
||||
{{# }else{}}
|
||||
不推荐
|
||||
否
|
||||
{{#}}}
|
||||
</script>
|
||||
<!-- 表格操作列 -->
|
||||
|
|
@ -94,7 +92,7 @@
|
|||
cols: [
|
||||
{field: 'name', title: '分类名称',width: 280},
|
||||
{field: '#image', title: '分类图标', width: 120,style:'height:100px;',toolbar: '#image', align: 'center'},
|
||||
{templet: '#is_recommend', title: '首页推荐', width: 100,align: 'center'},
|
||||
{templet: '#is_recommend', title: '惠藏百件', width: 100,align: 'center'},
|
||||
{templet: '#is_show', title: '显示', width: 100},
|
||||
{field: 'sort', title: '排序', width: 80, align: 'center',event: 'tips',sort: true},
|
||||
{fixed: 'right', align: 'center', toolbar: '#goods_category-operation', title: '操作', width: 180}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
<li class="layui-this">服务协议</li>
|
||||
<li>隐私政策</li>
|
||||
<li>售后保障</li>
|
||||
<li>选择理由</li>
|
||||
<li>支付方式</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
|
|
@ -47,6 +49,20 @@
|
|||
<textarea name="after_sale" id="after_sale" lay-verify="content" class="field-content">{$config.after_sale}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
<label class="layui-form-label"style="white-space: nowrap;">内容:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="payment" id="payment" lay-verify="content" class="field-content">{$config.payment}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
<label class="layui-form-label"style="white-space: nowrap;">内容:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="reason" id="reason" lay-verify="content" class="field-content">{$config.reason}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
|
@ -84,12 +100,16 @@
|
|||
var service = likeedit.build('service'); //建立编辑器
|
||||
var privacy = likeedit.build('privacy'); //建立编辑器
|
||||
var after_sale = likeedit.build('after_sale'); //建立编辑器
|
||||
var payment = likeedit.build('payment'); //建立编辑器
|
||||
var reason = likeedit.build('reason'); //建立编辑器
|
||||
form.verify({
|
||||
|
||||
content: function() {
|
||||
likeedit.sync(service)
|
||||
likeedit.sync(privacy)
|
||||
likeedit.sync(after_sale)
|
||||
likeedit.sync(payment)
|
||||
likeedit.sync(reason)
|
||||
}
|
||||
})
|
||||
form.verify({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,133 @@
|
|||
{layout name="layout2" /}
|
||||
<style>
|
||||
.layui-form-label {
|
||||
color: #6a6f6c;
|
||||
}
|
||||
.goods-li {
|
||||
float: left;
|
||||
opacity: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.goods-img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
padding: 4px;
|
||||
}
|
||||
.goods-img-del-x {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
top: -4px;
|
||||
right: -2px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 16px;
|
||||
line-height: 16px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background: hsla(0, 0%, 60%, .6);
|
||||
border-radius: 10px;
|
||||
}
|
||||
#image{
|
||||
left:110px;
|
||||
}
|
||||
#notice{ left:110px;}
|
||||
</style>
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-category" id="layuiadmin-form-category" style="padding: 20px 30px 0 0;">
|
||||
<input type="hidden" value="0" name="id">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>门店名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" lay-verify="required" lay-verType="tips" placeholder="请输入标题" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">门店封面图</label>
|
||||
<div class="layui-input-inline">
|
||||
<div class="" style="height:80px;line-height:80px">
|
||||
<input name="image" type="hidden" value="">
|
||||
<div class="goods-img-add"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class=" layui-form-mid layui-word-aux" id="image">建议尺寸:500*500像素</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>详细地址</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="address" lay-verify="required" lay-verType="tips" placeholder="请输入门店地址" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>营业时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="business" lay-verify="required" lay-verType="tips" placeholder="请输入营业时间" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>交通情况</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="traffic" lay-verify="required" lay-verType="tips" placeholder="请输入门店交通" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>联系方式</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="contact" lay-verify="required" lay-verType="tips" placeholder="请输入门店联系方式" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">门店状态</label>
|
||||
<div class="layui-input-inline" >
|
||||
<input type="radio" name="is_show" lay-filter="is_show" style="width: 500px" value=1 title="显示" checked >
|
||||
<input type="radio" name="is_show" lay-filter="is_show" style="width: 500px" value=0 title="隐藏">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="add-store-submit" id="add-store-submit" value="确认">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form','likeedit','like'], function(){
|
||||
var $ = layui.$
|
||||
,form = layui.form
|
||||
,like = layui.like
|
||||
,likeedit = layui.likeedit;
|
||||
|
||||
//上传图片
|
||||
like.imageUpload('.goods-img-add', function (uri, element) {
|
||||
if(uri.length>1){
|
||||
layer.msg('最多最能选中1张图片');
|
||||
return;
|
||||
}
|
||||
var html = '<div class="goods-li">\n' +
|
||||
'<img class="goods-img" ' +
|
||||
'src="' + uri[0] + '">' +
|
||||
'<a class="goods-img-del-x">x</a>' +
|
||||
'</div>';
|
||||
element.prev().val(like.getUrlFileName(uri[0], '{$storageUrl}'));
|
||||
element.parent().append(html);
|
||||
element.css('display','none');
|
||||
}, true);
|
||||
//删除图片
|
||||
$(document).on('click', '.goods-img-del-x', function () {
|
||||
$(this).parent().siblings('input').val('');
|
||||
$(this).parent().prev().css('display','block');
|
||||
$(this).parent().remove();
|
||||
});
|
||||
//显示图片
|
||||
$(document).on('click', '.goods-img', function () {
|
||||
var image = $(this).attr('src');
|
||||
like.showImg(image,600);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
{layout name="layout2" /}
|
||||
<style>
|
||||
.layui-form-label {
|
||||
color: #6a6f6c;
|
||||
}
|
||||
.goods-li {
|
||||
float: left;
|
||||
opacity: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.goods-img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
padding: 4px;
|
||||
}
|
||||
.goods-img-del-x {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
top: -4px;
|
||||
right: -2px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 16px;
|
||||
line-height: 16px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background: hsla(0, 0%, 60%, .6);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#image{
|
||||
left:110px;
|
||||
}
|
||||
#notice{ left:110px;}
|
||||
</style>
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-category" id="layuiadmin-form-category" style="padding: 20px 30px 0 0;">
|
||||
<input type="hidden" value="{$article.id}" name="id">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>门店名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" value="{$article.title}" lay-verify="required" lay-verType="tips" placeholder="请输入门店名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">门店封面图</label>
|
||||
<div class="layui-input-inline">
|
||||
<div style="height:80px;line-height:80px">
|
||||
<input name="image" type="hidden" value="{$article.image}">
|
||||
|
||||
{if !empty($article.image)}
|
||||
<div class="goods-img-add" style="display: none" ></div>
|
||||
<div class="goods-li">
|
||||
<img class="goods-img" src="{$article.abs_image}">
|
||||
<a class="goods-img-del-x" style="display: none">x</a>
|
||||
</div>
|
||||
{else}
|
||||
<div class="goods-img-add" ></div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class=" layui-form-mid layui-word-aux" id="image">建议尺寸:500*500像素</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>详细地址</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="address" value="{$article.address}" lay-verify="required" lay-verType="tips" placeholder="请输入门店地址" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>营业时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="business" value="{$article.business}" lay-verify="required" lay-verType="tips" placeholder="请输入营业时间" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>交通情况</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="traffic" value="{$article.traffic}" lay-verify="required" lay-verType="tips" placeholder="请输入门店交通" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>联系方式</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="contact" value="{$article.contact}" lay-verify="required" lay-verType="tips" placeholder="请输入门店联系方式" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">门店状态</label>
|
||||
<div class="layui-input-inline" >
|
||||
<input type="radio" name="is_show" lay-filter="is_show" style="width: 500px" value=1 title="显示" {if condition="$article.is_show eq 1" }checked{/if}>
|
||||
<input type="radio" name="is_show" lay-filter="is_show" style="width: 500px" value=0 title="隐藏"{if condition="$article.is_show eq 0" }checked{/if}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="edit-store-submit" id="edit-store-submit" value="确认">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form','likeedit','like'], function(){
|
||||
var $ = layui.$
|
||||
,form = layui.form
|
||||
,like = layui.like
|
||||
,likeedit = layui.likeedit;
|
||||
//上传图片
|
||||
like.imageUpload('.goods-img-add', function (uri, element) {
|
||||
if(uri.length>1){
|
||||
layer.msg('最多最能选中1张图片');
|
||||
return;
|
||||
}
|
||||
var html = '<div class="goods-li">\n' +
|
||||
'<img class="goods-img" ' +
|
||||
'src="' + uri[0] + '">' +
|
||||
'<a class="goods-img-del-x">x</a>' +
|
||||
'</div>';
|
||||
element.prev().val(like.getUrlFileName(uri[0], '{$storageUrl}'));
|
||||
element.parent().append(html);
|
||||
element.css('display','none');
|
||||
}, true);
|
||||
//删除图片
|
||||
$(document).on('click', '.goods-img-del-x', function () {
|
||||
$(this).parent().siblings('input').val('');
|
||||
$(this).parent().prev().css('display','block');
|
||||
$(this).parent().remove();
|
||||
});
|
||||
//显示图片
|
||||
$(document).on('click', '.goods-img', function () {
|
||||
var image = $(this).attr('src');
|
||||
like.showImg(image,600);
|
||||
});
|
||||
|
||||
// 删除按钮的显示与隐藏
|
||||
$(document).on('mouseover', '.goods-img', function () {
|
||||
$(this).next().show();
|
||||
});
|
||||
$(document).on('mouseout', '.goods-img', function () {
|
||||
$(this).next().hide();
|
||||
});
|
||||
$(document).on('mouseover', '.goods-img-del-x', function () {
|
||||
$(this).show();
|
||||
});
|
||||
$(document).on('mouseout', '.goods-img-del-x', function () {
|
||||
$(this).hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,333 @@
|
|||
{layout name="layout1" /}
|
||||
<style>
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<p>*平台发布门店,可在商城首页栏目查看。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">关键词</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" id="title" placeholder="请输入" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-store {$view_theme_color}" lay-submit lay-filter="store-search">
|
||||
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-primary layuiadmin-btn-store }" lay-submit lay-filter="store-clear-search">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<div style="padding-bottom: 10px;">
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-store {$view_theme_color}" data-type="add">新增门店</button>
|
||||
</div>
|
||||
|
||||
<table id="store-lists" lay-filter="store-lists"></table>
|
||||
<script type="text/html" id="image">
|
||||
<img src="{{d.image}}" style="height:auto;width: auto" class="image-show">
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="store-operation">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="status_switch">
|
||||
{{# if(d.is_show == 1){ }}
|
||||
隐藏
|
||||
{{# } else { }}
|
||||
显示
|
||||
{{# } }}
|
||||
</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index','table','like'], function(){
|
||||
var $ = layui.$
|
||||
,form = layui.form
|
||||
,table = layui.table
|
||||
,like = layui.like;
|
||||
|
||||
//图片放大
|
||||
$(document).on('click', '.image-show', function () {
|
||||
var src = $(this).attr('src');
|
||||
like.showImg(src,600);
|
||||
});
|
||||
//监听搜索
|
||||
form.on('submit(store-search)', function(data){
|
||||
var field = data.field;
|
||||
//执行重载
|
||||
table.reload('store-lists', {
|
||||
where: field,
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
},
|
||||
|
||||
});
|
||||
});
|
||||
//监听重置
|
||||
form.on('submit(store-clear-search)', function(){
|
||||
$('#title').val('');
|
||||
$('#cid').val('');
|
||||
$('#is_notice').val('');
|
||||
form.render('select');
|
||||
//刷新列表
|
||||
table.reload('store-lists', {
|
||||
where: [],
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//事件
|
||||
var active = {
|
||||
add: function(){
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '添加门店'
|
||||
,content: '{:url("store/add")}'
|
||||
,area: ['90%','90%']
|
||||
,btn: ['确定', '取消']
|
||||
,yes: function(index, layero){
|
||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||
,submitID = 'add-store-submit'
|
||||
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||
var field = data.field;
|
||||
like.ajax({
|
||||
url:'{:url("store/add")}',
|
||||
data:field,
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('store-lists'); //数据刷新
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
submit.trigger('click');
|
||||
}
|
||||
});
|
||||
}
|
||||
,batchdel:function(){ //删除所选
|
||||
var checkStatus = table.checkStatus('store-lists')
|
||||
,checkData = checkStatus.data; //得到选中的数据
|
||||
//是否已选数据
|
||||
if(checkData.length === 0){
|
||||
return layer.msg('请选择数据');
|
||||
}else {
|
||||
//获取所选id
|
||||
ids = [];
|
||||
for (var i in checkData){
|
||||
ids.push(checkData[i]['id']);
|
||||
}
|
||||
|
||||
layer.confirm('确定删除所选门店信息?', function(index){
|
||||
like.ajax({
|
||||
url:'{:url("store/del")}',
|
||||
data:{id:ids},
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('store-lists'); //数据刷新
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
$('.layui-btn.layuiadmin-btn-store').on('click', function(){
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
|
||||
|
||||
table.render({
|
||||
elem: '#store-lists'
|
||||
,url: '{:url("store/lists")}'
|
||||
,cols: [[
|
||||
{type: 'checkbox',title: '当页全选'}
|
||||
,{field: 'title', title: '门店名称',width:150}
|
||||
,{field: 'image', title: '门店封面图',toolbar: '#image',width:150}
|
||||
,{field: 'address', title: '门店地址',width:150}
|
||||
,{field: 'traffic', title: '门店交通',width:150}
|
||||
,{field: 'contact', title: '门店联系方式',width:150}
|
||||
,{field: 'business', title:'门店营业时间', align: 'center',width:100}
|
||||
,{field: 'create_time', title: '创建时间',width:160}
|
||||
,{fixed: 'right', title: '操作', align: 'center', toolbar: '#store-operation',width:230}
|
||||
]]
|
||||
,page:true
|
||||
,text: {none: '暂无数据!'}
|
||||
,parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
|
||||
return {
|
||||
"code":res.code,
|
||||
"msg":res.msg,
|
||||
"count": res.data.count, //解析数据长度
|
||||
"data": res.data.lists, //解析数据列表
|
||||
};
|
||||
}
|
||||
,done: function(res, curr, count){
|
||||
setTimeout(function () {
|
||||
// 解决操作栏因为内容过多换行问题
|
||||
$(".layui-table-fixed-l .layui-table-body").removeAttr("style");
|
||||
$(".layui-table-fixed-r .layui-table-body").removeAttr("style");
|
||||
$(".layui-table-main tr").each(function (index, val) {
|
||||
console.log($(val).height());
|
||||
$($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
|
||||
$($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
|
||||
});
|
||||
}, 100)
|
||||
}
|
||||
});
|
||||
|
||||
//监听工具条
|
||||
table.on('tool(store-lists)', function(obj){
|
||||
if(obj.event === 'del'){
|
||||
var id = obj.data.id;
|
||||
var title = obj.data.title;
|
||||
layer.confirm('确定要删除门店:'+'<span style="color: red">'+title+'</span>', function(index){
|
||||
like.ajax({
|
||||
url:'{:url("store/del")}',
|
||||
data:{'id':id},
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index);
|
||||
table.reload('store-lists');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if(obj.event === 'edit'){
|
||||
var id = obj.data.id;
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: '编辑门店'
|
||||
,content: '{:url("store/edit")}?id='+id
|
||||
,area: ['90%','90%']
|
||||
,btn: ['确定', '取消']
|
||||
,yes: function(index, layero){
|
||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||
,submitID = 'edit-store-submit'
|
||||
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
||||
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||
var field = data.field;
|
||||
like.ajax({
|
||||
url:'{:url("store/edit")}',
|
||||
data:field,
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index);
|
||||
table.reload('store-lists');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
submit.trigger('click');
|
||||
}
|
||||
})
|
||||
}else if(obj.event === 'status_switch'){
|
||||
var id = obj.data.id;
|
||||
var status = obj.data.is_show;
|
||||
var title = obj.data.title;
|
||||
var confirm_text = '';
|
||||
if (status == 1){
|
||||
confirm_text = '确定隐藏门店:';
|
||||
status = 0;
|
||||
} else {
|
||||
status = 1;
|
||||
confirm_text = '确定显示门店:';
|
||||
}
|
||||
|
||||
layer.confirm(confirm_text+'<span style="color: red">'+title+'</span>', function(index){
|
||||
like.ajax({
|
||||
url:'{:url("store/switchStatus")}',
|
||||
data:{id:id,is_show:status},
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('store-lists');
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
|
@ -65,6 +65,22 @@
|
|||
<label class=" layui-form-mid layui-word-aux" id="image">建议尺寸:730*530像素</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">首页推荐</label>
|
||||
<div class="layui-input-inline" id="" >
|
||||
<input type="radio" name="is_notice" lay-filter="is_notice" style="width: 500px" value=1 title="是" checked >
|
||||
<input type="radio" name="is_notice" lay-filter="is_notice" style="width: 500px" value=0 title="否">
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class=" layui-form-mid layui-word-aux" id="notice">在商城首页的名家推荐显示</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="white-space: nowrap;">职位:</label>
|
||||
<div class="layui-input-inline" style="width: 400px">
|
||||
<input type="text" name="position" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="white-space: nowrap;">荣誉:</label>
|
||||
<div class="layui-input-inline" style="width: 400px">
|
||||
|
|
|
|||
|
|
@ -73,6 +73,22 @@
|
|||
<label class=" layui-form-mid layui-word-aux" id="image">建议尺寸:730*530像素</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">首页推荐</label>
|
||||
<div class="layui-input-inline" id="" >
|
||||
<input type="radio" name="is_notice" lay-filter="is_notice" style="width: 500px" value=1 title="是" {if condition="$info.is_notice eq 1" }checked{/if}>
|
||||
<input type="radio" name="is_notice" lay-filter="is_notice" style="width: 500px" value=0 title="否"{if condition="$info.is_notice eq 0" }checked{/if}>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class=" layui-form-mid layui-word-aux" id="notice">在商城首页的名家推荐显示</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="white-space: nowrap;">职位:</label>
|
||||
<div class="layui-input-inline" style="width: 400px">
|
||||
<input type="text" name="position" value="{$info.position}" placeholder="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="white-space: nowrap;">荣誉:</label>
|
||||
<div class="layui-input-inline" style="width: 400px">
|
||||
|
|
|
|||
|
|
@ -9,17 +9,25 @@ namespace app\api\controller;
|
|||
use app\api\logic\GoodsLogic;
|
||||
class Goods extends ApiBase{
|
||||
|
||||
public $like_not_need_login = ['getgoodsdetail', 'getgoodslist','getbestlist','gethostlist','getsearchpage'];
|
||||
public $like_not_need_login = ['getgoodsdetail', 'getgoodslist','getbestlist','gethostlist','getsearchpage','tjgoodslist'];
|
||||
|
||||
/**
|
||||
* note 商品列表
|
||||
* create_time 2020/10/20 11:12
|
||||
*/
|
||||
public function getGoodsList(){
|
||||
$get = $this->request->get();
|
||||
$goods_list = GoodsLogic::getGoodsList($this->user_id, $get, $this->page_no, $this->page_size);
|
||||
$this->_success('获取成功',$goods_list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* note 商品列表筛选条件
|
||||
*/
|
||||
public function tjGoodsList(){
|
||||
$get = $this->request->get();
|
||||
$tjgoods_list = GoodsLogic::tjGoodsList();
|
||||
$this->_success('获取成功',$tjgoods_list);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,27 @@ namespace app\api\controller;
|
|||
use app\api\logic\PcLogic;
|
||||
|
||||
class Pc extends ApiBase{
|
||||
public $like_not_need_login = ['index','commonData','goodsList'];
|
||||
public $like_not_need_login = ['index','commonData','goodsList','supplierList','supplierclassList','temaigoods','baijianclass','cangpingoods','getsupplierDetail'];
|
||||
/**
|
||||
* Notes: 惠藏百件分类
|
||||
* @author: kiki
|
||||
*/
|
||||
public function baijianclass(){
|
||||
$lists = PcLogic::baijian_goods_category();
|
||||
return $this->_success('',$lists);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 惠藏藏品接口
|
||||
* @author: kiki
|
||||
*/
|
||||
public function cangpingoods(){
|
||||
$lists = PcLogic::cangpingoods();
|
||||
return $this->_success('',$lists);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: pc端首页接口
|
||||
* @author: kiki
|
||||
|
|
@ -19,6 +39,48 @@ class Pc extends ApiBase{
|
|||
return $this->_success('',$lists);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 获取分类专家列表
|
||||
* @author: kiki
|
||||
*/
|
||||
public function supplierclassList(){
|
||||
$lists = PcLogic::supplierclssList();
|
||||
return $this->_success('',$lists);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:获取专家列表
|
||||
* @author:kiki
|
||||
*/
|
||||
public function supplierList(){
|
||||
$cid = $this->request->get('category_id','');
|
||||
$list = PcLogic::supplierList($this->page_no,$this->page_size,$cid);
|
||||
return $this->_success('',$list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:获取专家详情
|
||||
* @author:kiki
|
||||
*/
|
||||
public function getsupplierDetail(){
|
||||
$id = $this->request->get('id');
|
||||
$supplier = PcLogic::getsupplierDetail($id);
|
||||
if($supplier){
|
||||
$this->_success('获取成功',$supplier);
|
||||
}
|
||||
$this->_error('专家不存在',[],0,0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 特卖商城接口
|
||||
* @author: kiki
|
||||
*/
|
||||
public function temaigoods(){
|
||||
$lists = PcLogic::temaigoods();
|
||||
return $this->_success('',$lists);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:pc广告公告数据
|
||||
* @author: kiki
|
||||
|
|
|
|||
|
|
@ -12,57 +12,126 @@ use app\common\model\TeamActivity;
|
|||
use app\common\model\TeamFound;
|
||||
use app\common\model\TeamGoodsItem;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\UrlServer;
|
||||
use think\Db;
|
||||
use think\facade\Hook;
|
||||
|
||||
class GoodsLogic{
|
||||
|
||||
//商品列表筛选条件
|
||||
public static function tjGoodsList(){
|
||||
//容量筛选表
|
||||
$capacity_list = Db::name('screen_capacity')
|
||||
->where(['del'=>0,'is_show'=>1])
|
||||
->order('sort desc')
|
||||
->field('id,name')
|
||||
->select();
|
||||
|
||||
//泥料筛选表
|
||||
$mud_list = Db::name('screen_mud')
|
||||
->where(['del'=>0,'is_show'=>1])
|
||||
->order('sort desc')
|
||||
->field('id,name')
|
||||
->select();
|
||||
|
||||
//价格筛选表
|
||||
$price_list = Db::name('screen_price')
|
||||
->where(['del'=>0,'is_show'=>1])
|
||||
->order('sort desc')
|
||||
->field('id,name')
|
||||
->select();
|
||||
|
||||
//尺寸筛选表
|
||||
$size_list = Db::name('screen_size')
|
||||
->where(['del'=>0,'is_show'=>1])
|
||||
->order('sort desc')
|
||||
->field('id,name')
|
||||
->select();
|
||||
|
||||
//壶型筛选表
|
||||
$category_list = Db::name('goods_brand')
|
||||
->where(['del'=>0,'is_show'=>1])
|
||||
->order('sort desc')
|
||||
->field('id,name,image')
|
||||
->select();
|
||||
foreach ($category_list as $key => $v1){
|
||||
$category_list[$key]['image']=UrlServer::getFileUrl($v1['image']);
|
||||
}
|
||||
$list = [
|
||||
'capacity_list' => $capacity_list,//容量筛选表
|
||||
'mud_list' => $mud_list,//泥料筛选表
|
||||
'price_list' => $price_list,//价格筛选表
|
||||
'size_list' => $size_list,//尺寸筛选表
|
||||
'category_list' => $category_list //壶型筛选表
|
||||
];
|
||||
return $list;
|
||||
}
|
||||
|
||||
//商品列表
|
||||
public static function getGoodsList($user_id,$get,$page,$size){
|
||||
$where = [];
|
||||
$order = [];
|
||||
$where[] = ['status','=',1];
|
||||
$where[] = ['del','=',0];
|
||||
$where[] = ['g.status','=',1];
|
||||
$where[] = ['g.del','=',0];
|
||||
|
||||
$goods = new Goods();
|
||||
//品牌筛选
|
||||
if(isset($get['brand_id']) && $get['brand_id']) {
|
||||
$where[] = ['brand_id', '=', $get['brand_id']];
|
||||
}
|
||||
//分类筛选
|
||||
//壶型筛选
|
||||
if(isset($get['category_id']) && $get['category_id']){
|
||||
$where[] = ['first_category_id|second_category_id|third_category_id','=',$get['category_id']];
|
||||
}
|
||||
|
||||
//价格
|
||||
if(isset($get['price']) && $get['price']) {
|
||||
$screen_price_info = Db::name('screen_price')->field('start_price,end_price')->where(['id'=>$get['price'],'del'=>0])->find();
|
||||
if($screen_price_info){
|
||||
$where[] = ['min_price','>=',strtotime($screen_price_info['start_price'])];
|
||||
$where[] = ['min_price','<=',strtotime($screen_price_info['end_price'])];
|
||||
}
|
||||
}
|
||||
|
||||
//容量
|
||||
if(isset($get['rongliang']) && $get['rongliang']) {
|
||||
$screen_capacity_info = Db::name('screen_capacity')->field('start_capacity,end_capacity')->where(['id'=>$get['rongliang'],'del'=>0])->find();
|
||||
if($screen_capacity_info){
|
||||
$where[] = ['rongliang_name','>=',strtotime($screen_capacity_info['start_capacity'])];
|
||||
$where[] = ['rongliang_name','<=',strtotime($screen_capacity_info['end_capacity'])];
|
||||
}
|
||||
}
|
||||
//泥料
|
||||
if(isset($get['mud_id']) && $get['mud_id']) {
|
||||
$where[] = ['mud_id', '=', $get['mud_id']];
|
||||
}
|
||||
|
||||
//尺寸
|
||||
if(isset($get['size_id']) && $get['size_id']) {
|
||||
$where[] = ['size_id', '=', $get['size_id']];
|
||||
}
|
||||
|
||||
//关键词搜索
|
||||
if(isset($get['keyword']) && $get['keyword']){
|
||||
$where[] = ['name','like','%'.$get['keyword'].'%'];
|
||||
$where[] = ['g.name','like','%'.$get['keyword'].'%'];
|
||||
if($user_id){//记录关键词
|
||||
self::recordKeyWord(trim($get['keyword']),$user_id);
|
||||
}
|
||||
}
|
||||
//销量排序
|
||||
if(isset($get['sales_sum']) && $get['sales_sum']){
|
||||
$order['sales_sum'] = $get['sales_sum'];
|
||||
}
|
||||
//价格排序
|
||||
if(isset($get['price']) && $get['price']){
|
||||
$order['min_price'] = $get['price'];
|
||||
}
|
||||
|
||||
$order['sort'] = 'desc';
|
||||
$order['id'] = 'desc';
|
||||
|
||||
$goods_count = $goods
|
||||
$order['g.sort'] = 'desc';
|
||||
$order['g.id'] = 'desc';
|
||||
$goods_count =Db::name('goods g')
|
||||
->where($where)
|
||||
->join('screen_mud sm', 'g.mud_id = sm.id')
|
||||
->join('supplier s', 'g.supplier_id = s.id')
|
||||
->count();
|
||||
|
||||
$goods_list = $goods
|
||||
$goods_list =Db::name('goods g')
|
||||
->where($where)
|
||||
->page($page,$size)
|
||||
->order($order)
|
||||
->field('id,name,image,min_price as price,market_price,sales_sum+virtual_sales_sum as sales_sum,sort')
|
||||
->select();
|
||||
|
||||
->field('g.id as goods_id,g.name as goods_name,g.code,g.image,min_price as price,rongliang_name,sm.name as mud_name,s.name as supplier_name,g.code')
|
||||
->join('screen_mud sm', 'g.mud_id = sm.id')
|
||||
->join('supplier s', 'g.supplier_id = s.id')
|
||||
->select();
|
||||
foreach ($goods_list as $key => $v1){
|
||||
$goods_list[$key]['image']=UrlServer::getFileUrl($v1['image']);
|
||||
}
|
||||
$more = is_more($goods_count,$page,$size); //是否有下一页
|
||||
|
||||
$data = [
|
||||
|
|
@ -87,69 +156,33 @@ class GoodsLogic{
|
|||
}
|
||||
//商品详情
|
||||
public static function getGoodsDetail($user_id,$id){
|
||||
|
||||
$goods = Goods::get(['id'=>$id,'status'=>1],['goods_image','goods_item']);
|
||||
|
||||
if($goods){
|
||||
//点击量
|
||||
$goods->click_count = $goods->click_count + 1;
|
||||
$goods->save();
|
||||
$goods->sales_sum += $goods->virtual_sales_sum;
|
||||
$goods->is_collect = 0;
|
||||
$goods->member_price = 0;
|
||||
$goods->append(['order_give_integral', 'commission_price']);
|
||||
|
||||
//检查商品是否整在参加活动,如果正在参加活动替换商品的价格为活动价
|
||||
$goods = self::checkActivity($goods);
|
||||
if($user_id) {
|
||||
//是否收藏
|
||||
$collect = Db::name('goods_collect')->where(['user_id'=>$user_id,'goods_id'=>$id])->find();
|
||||
$goods->is_collect= $collect ? 1 : 0;
|
||||
//专家信息
|
||||
$supplier = Db::name('supplier')
|
||||
->where(['del'=>0,'id'=>$goods->supplier_id])
|
||||
->order('create_time desc')
|
||||
->field('id,name,remark,avatar')
|
||||
->find();
|
||||
$supplier['avatar']=UrlServer::getFileUrl($supplier['avatar']);
|
||||
$goods->supplier_list=$supplier;
|
||||
|
||||
$goods->payment=ConfigServer::get('policy', 'payment');
|
||||
$goods->reason = ConfigServer::get('policy', 'reason');
|
||||
$goods->after_sale =ConfigServer::get('policy', 'after_sale');
|
||||
|
||||
//会员折扣
|
||||
$member_discount = Db::name('user_level l')
|
||||
->join('user u', 'u.level = l.id')
|
||||
->where(['u.id' => $user_id])
|
||||
->value('discount');
|
||||
$price_array = [];
|
||||
//处理会员折扣价格
|
||||
if ($goods->is_member > 0 && $member_discount > 0) {
|
||||
//会员价格
|
||||
foreach ($goods->goods_item as $item => $value){
|
||||
$goods->goods_item[$item]['member_price'] = 0;
|
||||
if($member_discount){
|
||||
$member_price = round($value['price'] * $member_discount / 10,2);
|
||||
$goods->goods_item[$item]['member_price'] = $member_price;
|
||||
$price_array[] = $member_price;
|
||||
}
|
||||
}
|
||||
$price_array && $goods->member_price = min($price_array);
|
||||
}
|
||||
//多规格,按最高的价格计算积分
|
||||
if($price_array && 2 === $goods->give_integral_type){
|
||||
$price = $price_array ? max($price_array) : $goods->max_price;
|
||||
$goods->order_give_integral = intval($price * $goods->give_integral / 100);
|
||||
}
|
||||
}
|
||||
//猜你喜欢
|
||||
$goods->Like();
|
||||
//商品规格
|
||||
$goods->GoodsSpec();
|
||||
$goods->append(['comment'])->hidden(['Spec','GoodsSpecValue'])
|
||||
->visible(['id','name','image','video','stock','remark','content','sales_sum',
|
||||
'click_count','price','market_price','is_collect','goods_spec','goods_image',
|
||||
'goods_item','activity','member_price']);
|
||||
->visible(['id','name','code','image','stock','content',
|
||||
'price','market_price','goods_spec','goods_image',
|
||||
'goods_item','supplier_list','payment','reason','after_sale']);
|
||||
|
||||
//判断是否开启了拼团
|
||||
if ($goods['is_team']) {
|
||||
$resTeam = self::getTeam($goods);
|
||||
// 如果活动没结束,则返回拼团数据, 否则把商品是否已开团状态改为,不是开团商品
|
||||
if ($resTeam !== 100 and is_array($resTeam)) {
|
||||
$goods['activity'] = $resTeam;
|
||||
} else {
|
||||
$goods['is_team'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 钩子-记录足迹(浏览商品)
|
||||
Hook::listen('footprint', [
|
||||
|
|
|
|||
|
|
@ -13,52 +13,45 @@ use app\common\server\UrlServer;
|
|||
use think\Db;
|
||||
|
||||
class PcLogic{
|
||||
|
||||
/**
|
||||
* Notes:惠藏百件分类
|
||||
* @return array
|
||||
* @author:kiki
|
||||
*/
|
||||
public static function baijian_goods_category(){
|
||||
$category_list = Db::name('goods_category')
|
||||
->where(['del'=>0,'is_recommend'=>1])
|
||||
->order('sort desc')
|
||||
->field('id,name')
|
||||
->select();
|
||||
return $category_list;
|
||||
}
|
||||
/**
|
||||
* Notes:pc端首页接口
|
||||
* @return array
|
||||
* @author:kiki
|
||||
*/
|
||||
public static function pcLists(){
|
||||
$goods = new Goods();
|
||||
|
||||
//热销榜单
|
||||
$host_list = $goods
|
||||
->where(['del'=>0,'status'=>1])
|
||||
->field('id,name,image,min_price as price,market_price,sales_sum+virtual_sales_sum as sales_sum')
|
||||
->order('sales_sum desc,click_count desc')
|
||||
->limit(10)
|
||||
->select();
|
||||
|
||||
//新品推荐
|
||||
$new_list = $goods
|
||||
->where(['del'=>0,'status'=>1,'is_new'=>1])
|
||||
->field('id,name,image,min_price as price,market_price,sales_sum+virtual_sales_sum as sales_sum')
|
||||
->order('id desc,sort desc')
|
||||
->limit(10)
|
||||
->select();
|
||||
|
||||
|
||||
//好物优选
|
||||
$best_list = $goods
|
||||
->where(['del'=>0,'status'=>1,'is_best'=>1])
|
||||
->field('id,name,image,min_price as price,market_price,sales_sum+virtual_sales_sum as sales_sum')
|
||||
->order('id desc,sort desc')
|
||||
//新品上架
|
||||
$new_list = Db::name('goods g')
|
||||
->where(['g.del'=>0,'g.status'=>1,'g.is_new'=>1])
|
||||
->field('g.id as goods_id,g.name as goods_name,g.code,g.image,min_price as price,rongliang_name,sm.name as mud_name,s.name as supplier_name')
|
||||
->join('screen_mud sm', 'g.mud_id = sm.id')
|
||||
->join('supplier s', 'g.supplier_id = s.id')
|
||||
->order('g.id desc,g.sort desc')
|
||||
->limit(10)
|
||||
->select();
|
||||
|
||||
$ad_list = Db::name('ad a')
|
||||
->join('ad_position ap', 'a.pid = ap.id')
|
||||
->where(['pid' =>[18,19,20,21],'a.status' => 1,'a.del' => 0,'ap.status' => 1,'ap.del' => 0])
|
||||
->where(['pid' =>[2],'a.status' => 1,'a.del' => 0,'ap.status' => 1,'ap.del' => 0])
|
||||
->order('a.id desc')
|
||||
->field('a.*')
|
||||
->select();
|
||||
|
||||
|
||||
$host_ad = []; //热销榜单广告
|
||||
$new_ad = []; //新品推荐广告
|
||||
$best_ad = []; //好物优选广告
|
||||
$category_ad = []; //分类广告
|
||||
|
||||
$index_ad = []; //首页轮播图广告
|
||||
foreach ($ad_list as $ad){
|
||||
$url = $ad['link'];
|
||||
$is_tab = 0;
|
||||
|
|
@ -77,9 +70,9 @@ class PcLogic{
|
|||
];
|
||||
break;
|
||||
}
|
||||
//首页热销榜单广告
|
||||
if(empty($host_ad) && 18 == $ad['pid']){
|
||||
$host_ad = [
|
||||
//首页轮播图广告
|
||||
if(empty($index_ad) && 2 == $ad['pid']){
|
||||
$index_ad = [
|
||||
'image' => UrlServer::getFileUrl($ad['image']),
|
||||
'link' => $url,
|
||||
'link_type' => $ad['link_type'],
|
||||
|
|
@ -87,85 +80,147 @@ class PcLogic{
|
|||
'is_tab' => $is_tab,
|
||||
];
|
||||
}
|
||||
//首页新品推荐广告
|
||||
if(empty($new_ad) && 19 == $ad['pid']){
|
||||
$new_ad = [
|
||||
'image' => UrlServer::getFileUrl($ad['image']),
|
||||
'link' => $url,
|
||||
'link_type' => $ad['link_type'],
|
||||
'params' => $params,
|
||||
'is_tab' => $is_tab,
|
||||
];
|
||||
}
|
||||
//首页好物优选广告
|
||||
if(empty($best_ad) && 20 == $ad['pid']){
|
||||
$best_ad = [
|
||||
'image' => UrlServer::getFileUrl($ad['image']),
|
||||
'link' => $url,
|
||||
'link_type' => $ad['link_type'],
|
||||
'params' => $params,
|
||||
'is_tab' => $is_tab,
|
||||
];
|
||||
}
|
||||
//首页分类广告
|
||||
if(21 == $ad['pid']){
|
||||
|
||||
$category_ad[$ad['category_id']] = [
|
||||
'image' => UrlServer::getFileUrl($ad['image']),
|
||||
'link' => $url,
|
||||
'link_type' => $ad['link_type'],
|
||||
'params' => $params,
|
||||
'is_tab' => $is_tab,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//分类信息
|
||||
$goods_category = new \app\admin\model\GoodsCategory();
|
||||
$goods_category_list = $goods_category
|
||||
->where(['del'=>0, 'level'=>1,'is_recommend'=>1])
|
||||
->with(['sons'])
|
||||
->field('id,name')
|
||||
//紫砂资讯
|
||||
$article = Db::name('article')
|
||||
->where(['del'=>0,'is_notice'=>1,'is_show'=>1])
|
||||
->order('create_time desc')
|
||||
->field('id,title,synopsis,image,create_time')
|
||||
->limit(4)
|
||||
->select();
|
||||
foreach ($article as $key => $v1){
|
||||
$article[$key]['image']=UrlServer::getFileUrl($v1['image']);
|
||||
$article[$key]['create_time'] = date('Y-m-d', $v1['create_time']);
|
||||
}
|
||||
|
||||
$category_list = [];
|
||||
foreach ($goods_category_list as $key => $goods_category){
|
||||
$sons = [];
|
||||
$goods_list = $goods
|
||||
->where(['first_category_id'=>$goods_category['id'],'del'=>0,'status'=>1])
|
||||
->field('id,name,image,min_price as price,market_price,sales_sum+virtual_sales_sum as sales_sum')
|
||||
->limit(8)
|
||||
->select();
|
||||
foreach ($goods_category['sons'] as $son){
|
||||
$sons[] = [
|
||||
'id' => $son['id'],
|
||||
'name' => $son['name'],
|
||||
];
|
||||
}
|
||||
$ad = $category_ad[$goods_category['id']] ?? [];
|
||||
$category_list[] = [
|
||||
'id' => $goods_category['id'],
|
||||
'name' => $goods_category['name'],
|
||||
'ad' => $ad,
|
||||
'sons' => $sons,
|
||||
'goods_list'=> $goods_list,
|
||||
];
|
||||
//专家信息
|
||||
$supplier = Db::name('supplier')
|
||||
->where(['del'=>0,'is_notice'=>1])
|
||||
->order('create_time desc')
|
||||
->field('id,name,remark,avatar')
|
||||
->limit(6)
|
||||
->select();
|
||||
foreach ($supplier as $key => $v2){
|
||||
$supplier[$key]['avatar']=UrlServer::getFileUrl($v2['avatar']);
|
||||
}
|
||||
|
||||
//门店信息
|
||||
$store = Db::name('store')
|
||||
->where(['del'=>0,'is_show'=>1])
|
||||
->order('create_time desc')
|
||||
->field('id,title,address,image,business,traffic,contact')
|
||||
->limit(4)
|
||||
->select();
|
||||
foreach ($store as $key => $v2){
|
||||
$store[$key]['image']=UrlServer::getFileUrl($v1['image']);
|
||||
}
|
||||
|
||||
$list = [
|
||||
'host_ad' => $host_ad,
|
||||
'host_list' => $host_list,
|
||||
'new_ad' => $new_ad,
|
||||
'new_list' => $new_list,
|
||||
'best_ad' => $best_ad,
|
||||
'best_list' => $best_list,
|
||||
'category_list' => $category_list,
|
||||
'new_list' => $new_list,
|
||||
'index_ad' => $index_ad,
|
||||
'article' => $article,
|
||||
'supplier' => $supplier,
|
||||
'store' => $store
|
||||
];
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
||||
//专家信息
|
||||
public static function supplierclssList(){
|
||||
$supplier_category = new \app\admin\model\SupplierCategory();
|
||||
$supplier_category_list = $supplier_category
|
||||
->where(['del'=>0, 'is_show'=>1])
|
||||
->field('id,name')
|
||||
->select();
|
||||
$category_list = [];
|
||||
foreach ($supplier_category_list as $key => $supplier_category){
|
||||
$supplier_list = Db::name('supplier')
|
||||
->where(['cid'=>$supplier_category['id'],'del'=>0])
|
||||
->field('id,name')
|
||||
->select();
|
||||
if(!$supplier_list){
|
||||
continue;
|
||||
}
|
||||
$category_list[] = [
|
||||
'id' => $supplier_category['id'],
|
||||
'name' => $supplier_category['name'],
|
||||
'supplier_list'=> $supplier_list,
|
||||
];
|
||||
}
|
||||
return $category_list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes:获取专家列表
|
||||
* @param $page int 页码
|
||||
* @param $size int 每页数量
|
||||
* @param $cid int 分类id
|
||||
* @return array
|
||||
* @author: kiki
|
||||
*/
|
||||
public static function supplierList($page,$size,$cid){
|
||||
|
||||
$where[] = ['del','=',0];
|
||||
//按商品分类搜索
|
||||
if($cid){
|
||||
$where[] = ['cid','=',$cid];
|
||||
}
|
||||
$count =Db::name('supplier')
|
||||
->field('id,name,remark,avatar')
|
||||
->where($where)
|
||||
->count();
|
||||
|
||||
$list =Db::name('supplier')
|
||||
->order('create_time desc')
|
||||
->field('id,name,remark,avatar')
|
||||
->where($where)
|
||||
->page($page, $size)
|
||||
->select();
|
||||
$more = is_more($count, $page, $size); //是否有下一页
|
||||
return [
|
||||
'list' => $list,
|
||||
'page' => $page,
|
||||
'size' => $size,
|
||||
'count' => $count,
|
||||
'more' => $more
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes:获取专家详情
|
||||
* @param $cid int 专家id
|
||||
* @return array
|
||||
* @author: kiki
|
||||
*/
|
||||
public static function getsupplierDetail($id){
|
||||
|
||||
$where[] = ['del','=',0];
|
||||
$where[] = ['id','=',$id];
|
||||
$info =Db::name('supplier')
|
||||
->order('create_time desc')
|
||||
->field('id,name,remark,avatar,honor,position')
|
||||
->where($where)
|
||||
->find();
|
||||
|
||||
$goods_list=Db::name('goods g')
|
||||
->where(['g.del'=>0,'g.status'=>1,'g.supplier_id'=>$info['id']])
|
||||
->field('g.id as goods_id,g.name as goods_name,g.code,g.image,min_price as price,rongliang_name,sm.name as mud_name,s.name as supplier_name')
|
||||
->join('screen_mud sm', 'g.mud_id = sm.id')
|
||||
->join('supplier s', 'g.supplier_id = s.id')
|
||||
->order('g.id desc,g.sort desc')
|
||||
->select();
|
||||
return [
|
||||
'info' => $info,
|
||||
'goods_list' => $goods_list,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Notes:pc端获取公共数据
|
||||
* @param $user_id int 用户id
|
||||
|
|
@ -173,31 +228,220 @@ class PcLogic{
|
|||
* @author: kiki
|
||||
*/
|
||||
public static function commonData($user_id){
|
||||
$article = Db::name('article')
|
||||
->where(['del'=>0,'is_notice'=>1,'is_show'=>1])
|
||||
->order('create_time desc')
|
||||
->field('id,title')
|
||||
->limit(3)
|
||||
->select();
|
||||
$cart_num = 0;
|
||||
$coupon_num = 0;
|
||||
$nickname = '';
|
||||
|
||||
if($user_id){
|
||||
$cart_num = Db::name('cart')->where(['user_id'=>$user_id])->sum('goods_num');
|
||||
$coupon_num = Db::name('coupon_list')->where(['user_id'=>$user_id,'del'=>0,'status'=>0])->count();
|
||||
$nickname = Db::name('user')->where(['id'=>$user_id])->value('nickname');
|
||||
}
|
||||
$help_category_list = DB::name('help_category')
|
||||
->where('is_show', 1)
|
||||
->where(['del' => 0])
|
||||
->field('id,name')
|
||||
->select();
|
||||
$h_category_list = [];
|
||||
foreach ($help_category_list as $key => $help_category){
|
||||
$help_list = Db::name('help')
|
||||
->where(['cid'=>$help_category['id'],'del'=>0])
|
||||
->field('id,title')
|
||||
->select();
|
||||
$h_category_list[] = [
|
||||
'id' => $help_category['id'],
|
||||
'name' => $help_category['name'],
|
||||
'help_list'=> $help_list,
|
||||
];
|
||||
}
|
||||
return [
|
||||
'logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'pc_logo')),
|
||||
'name' => ConfigServer::get('website', 'name',''),
|
||||
'nickname' => $nickname,
|
||||
'kfphone' => ConfigServer::get('service','phone',''),
|
||||
'kf_qr_code' => UrlServer::getFileUrl(ConfigServer::get('service','image','')),
|
||||
'oa_qr_code' => UrlServer::getFileUrl(ConfigServer::get('oa', 'qr_code', '')),
|
||||
'h_category_list'=>$h_category_list,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:惠藏藏品列表
|
||||
* @author: kiki
|
||||
*/
|
||||
public static function cangpingoods(){
|
||||
|
||||
$ad_list = Db::name('ad a')
|
||||
->join('ad_position ap', 'a.pid = ap.id')
|
||||
->where(['pid' =>[24],'a.status' => 1,'a.del' => 0,'ap.status' => 1,'ap.del' => 0])
|
||||
->order('a.id desc')
|
||||
->field('a.*')
|
||||
->select();
|
||||
|
||||
|
||||
$ad = []; //广告
|
||||
foreach ($ad_list as $ad){
|
||||
$url = $ad['link'];
|
||||
$is_tab = 0;
|
||||
$params = [];
|
||||
switch ($ad['link_type']) {
|
||||
case 1:
|
||||
$page = Ad::getLinkPage($ad['client'], $ad['link']);
|
||||
$url = $page['path'];
|
||||
$is_tab = $page['is_tab'] ?? 0;
|
||||
break;
|
||||
case 2:
|
||||
$goods_path = Ad::getGoodsPath($ad['client']);
|
||||
$url = $goods_path;
|
||||
$params = [
|
||||
'id' => $ad['link'],
|
||||
];
|
||||
break;
|
||||
}
|
||||
//广告
|
||||
if(empty($tiemai_tup_ad) && 24 == $ad['pid']){
|
||||
$tiemai_tup_ad = [
|
||||
'image' => UrlServer::getFileUrl($ad['image']),
|
||||
'link' => $url,
|
||||
'link_type' => $ad['link_type'],
|
||||
'params' => $params,
|
||||
'is_tab' => $is_tab,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$where[] = ['g.del','=',0];
|
||||
$where[] = ['g.status','=',1];
|
||||
//藏品捡宝
|
||||
$where1[] = ['is_jiantreasure','=',1];
|
||||
//镇店藏品
|
||||
$where2[] = ['is_zdtreasure','=',1];
|
||||
|
||||
$jiantreasure_list =Db::name('goods g')
|
||||
->field('g.id as goods_id,g.name as goods_name,g.image,remark')
|
||||
->where($where)
|
||||
->where($where1)
|
||||
->page(0,7)
|
||||
->select();
|
||||
foreach ($jiantreasure_list as $key => $v1){
|
||||
$jiantreasure_list[$key]['image']=UrlServer::getFileUrl($v1['image']);
|
||||
}
|
||||
|
||||
$zdtreasure_list =Db::name('goods g')
|
||||
->field('g.id as goods_id,g.name as goods_name,g.image,remark')
|
||||
->where($where)
|
||||
->where($where2)
|
||||
->page(0,7)
|
||||
->select();
|
||||
foreach ($zdtreasure_list as $key => $v1){
|
||||
$zdtreasure_list[$key]['image']=UrlServer::getFileUrl($v1['image']);
|
||||
}
|
||||
return [
|
||||
'ad' => $tiemai_tup_ad,//广告
|
||||
'jiantreasure_list' => $jiantreasure_list,//藏品捡宝
|
||||
'zdtreasure_list' => $zdtreasure_list,//镇店藏品
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:特卖商品列表
|
||||
* @author: kiki
|
||||
*/
|
||||
public static function temaigoods(){
|
||||
|
||||
$ad_list = Db::name('ad a')
|
||||
->join('ad_position ap', 'a.pid = ap.id')
|
||||
->where(['pid' =>[16,21],'a.status' => 1,'a.del' => 0,'ap.status' => 1,'ap.del' => 0])
|
||||
->order('a.id desc')
|
||||
->field('a.*')
|
||||
->select();
|
||||
|
||||
$tiemai_tup_ad = []; //特卖大图广告
|
||||
$tiemai_bott_ad = []; //特卖小图广告
|
||||
foreach ($ad_list as $ad){
|
||||
$url = $ad['link'];
|
||||
$is_tab = 0;
|
||||
$params = [];
|
||||
switch ($ad['link_type']) {
|
||||
case 1:
|
||||
$page = Ad::getLinkPage($ad['client'], $ad['link']);
|
||||
$url = $page['path'];
|
||||
$is_tab = $page['is_tab'] ?? 0;
|
||||
break;
|
||||
case 2:
|
||||
$goods_path = Ad::getGoodsPath($ad['client']);
|
||||
$url = $goods_path;
|
||||
$params = [
|
||||
'id' => $ad['link'],
|
||||
];
|
||||
break;
|
||||
}
|
||||
//特卖大图广告
|
||||
if(empty($tiemai_tup_ad) && 21 == $ad['pid']){
|
||||
$tiemai_tup_ad = [
|
||||
'image' => UrlServer::getFileUrl($ad['image']),
|
||||
'link' => $url,
|
||||
'link_type' => $ad['link_type'],
|
||||
'params' => $params,
|
||||
'is_tab' => $is_tab,
|
||||
];
|
||||
}
|
||||
//特卖小图广告
|
||||
if(16 == $ad['pid']){
|
||||
$tiemai_bott_ad[] = [
|
||||
'image' => UrlServer::getFileUrl($ad['image']),
|
||||
'link' => $url,
|
||||
'link_type' => $ad['link_type'],
|
||||
'params' => $params,
|
||||
'is_tab' => $is_tab,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$where[] = ['g.del','=',0];
|
||||
$where[] = ['g.status','=',1];
|
||||
//新品上架
|
||||
$where1[] = ['is_new','=',1];
|
||||
//精品推荐
|
||||
$where2[] = ['is_best','=',1];
|
||||
//今日促销
|
||||
$where3[] = ['is_like','=',1];
|
||||
|
||||
$xinpin_list =Db::name('goods g')
|
||||
->field('g.id as goods_id,g.name as goods_name,g.code,g.image,min_price as price,rongliang_name,s.name as supplier_name')
|
||||
->join('supplier s', 'g.supplier_id = s.id')
|
||||
->where($where)
|
||||
->where($where1)
|
||||
->page(0,7)
|
||||
->select();
|
||||
foreach ($xinpin_list as $key => $v1){
|
||||
$xinpin_list[$key]['image']=UrlServer::getFileUrl($v1['image']);
|
||||
}
|
||||
|
||||
$jingpin_list =Db::name('goods g')
|
||||
->field('g.id as goods_id,g.name as goods_name,g.image,min_price as price')
|
||||
->where($where)
|
||||
->where($where2)
|
||||
->page(0,6)
|
||||
->select();
|
||||
foreach ($jingpin_list as $key => $v1){
|
||||
$jingpin_list[$key]['image']=UrlServer::getFileUrl($v1['image']);
|
||||
}
|
||||
|
||||
$cuxiao_list =Db::name('goods g')
|
||||
->field('g.id as goods_id,g.name as goods_name,g.image,min_price as price')
|
||||
->where($where)
|
||||
->where($where3)
|
||||
->page(0,6)
|
||||
->select();
|
||||
foreach ($cuxiao_list as $key => $v1){
|
||||
$cuxiao_list[$key]['image']=UrlServer::getFileUrl($v1['image']);
|
||||
}
|
||||
|
||||
return [
|
||||
'article' => $article,
|
||||
'logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'pc_logo')),
|
||||
'name' => ConfigServer::get('website', 'name',''),
|
||||
'cart_num' => $cart_num,
|
||||
'coupon_num' => $coupon_num,
|
||||
'nickname' => $nickname,
|
||||
'oa_qr_code' => UrlServer::getFileUrl(ConfigServer::get('oa', 'qr_code', '')),
|
||||
'mnp_qr_code' => UrlServer::getFileUrl(ConfigServer::get('mnp', 'qr_code', '')),
|
||||
'da_ad' => $tiemai_tup_ad,//大图
|
||||
'xiao_ad' => $tiemai_bott_ad,//4小图
|
||||
'xinpin_list' => $xinpin_list,//新品
|
||||
'jingpin_list' => $jingpin_list,//精品
|
||||
'cuxiao_list' => $cuxiao_list//促销
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -215,11 +459,11 @@ class PcLogic{
|
|||
*/
|
||||
public static function goodsList($page,$size,$name,$category_id,$type,$sort_type,$sort){
|
||||
|
||||
$where[] = ['del','=',0];
|
||||
$where[] = ['status','=',1];
|
||||
$where[] = ['g.del','=',0];
|
||||
$where[] = ['g.status','=',1];
|
||||
//按商品名称搜索
|
||||
if($name){
|
||||
$where[] = ['name','like','%'.$name.'%'];
|
||||
$where[] = ['g.name','like','%'.$name.'%'];
|
||||
|
||||
}
|
||||
//按商品分类搜索
|
||||
|
|
@ -230,11 +474,25 @@ class PcLogic{
|
|||
if(1 != $type){
|
||||
switch ($type){
|
||||
case 2:
|
||||
//新品上架
|
||||
$where[] = ['is_new','=',1];
|
||||
break;
|
||||
case 3:
|
||||
//精品推荐
|
||||
$where[] = ['is_best','=',1];
|
||||
break;
|
||||
case 4:
|
||||
//今日促销
|
||||
$where[] = ['is_like','=',1];
|
||||
break;
|
||||
case 5:
|
||||
//藏品捡宝
|
||||
$where[] = ['is_jiantreasure','=',1];
|
||||
break;
|
||||
case 6:
|
||||
//镇店藏品
|
||||
$where[] = ['is_zdtreasure','=',1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
//按排序条件显示
|
||||
|
|
@ -242,20 +500,24 @@ class PcLogic{
|
|||
if($sort_type && $sort){
|
||||
$order = [$sort_type=>$sort];
|
||||
}
|
||||
|
||||
$goods = new Goods();
|
||||
|
||||
$count = $goods
|
||||
$count =Db::name('goods g')
|
||||
->join('screen_mud sm', 'g.mud_id = sm.id')
|
||||
->join('supplier s', 'g.supplier_id = s.id')
|
||||
->where($where)
|
||||
->count();
|
||||
|
||||
$list = $goods
|
||||
->where($where)
|
||||
->field('id,name,image,min_price as price,market_price,sales_sum+virtual_sales_sum as sales_sum')
|
||||
->order($order)
|
||||
->page($page, $size)
|
||||
->select();
|
||||
|
||||
$list =Db::name('goods g')
|
||||
->field('g.id as goods_id,g.name as goods_name,g.code,g.image,min_price as price,rongliang_name,sm.name as mud_name,s.name as supplier_name')
|
||||
->join('screen_mud sm', 'g.mud_id = sm.id')
|
||||
->join('supplier s', 'g.supplier_id = s.id')
|
||||
->where($where)
|
||||
->order($order)
|
||||
->page($page, $size)
|
||||
->select();
|
||||
foreach ($list as $key => $v1){
|
||||
$list[$key]['image']=UrlServer::getFileUrl($v1['image']);
|
||||
}
|
||||
$more = is_more($count, $page, $size); //是否有下一页
|
||||
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php /*a:2:{s:92:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/supplier/edit.html";i:1640333906;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout2.html";i:1628618358;}*/ ?>
|
||||
<?php /*a:2:{s:92:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/supplier/edit.html";i:1641741931;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout2.html";i:1628618358;}*/ ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
@ -89,6 +89,22 @@
|
|||
<label class=" layui-form-mid layui-word-aux" id="image">建议尺寸:730*530像素</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">首页推荐</label>
|
||||
<div class="layui-input-inline" id="" >
|
||||
<input type="radio" name="is_notice" lay-filter="is_notice" style="width: 500px" value=1 title="是" <?php if($info['is_notice'] == 1): ?>checked<?php endif; ?>>
|
||||
<input type="radio" name="is_notice" lay-filter="is_notice" style="width: 500px" value=0 title="否"<?php if($info['is_notice'] == 0): ?>checked<?php endif; ?>>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class=" layui-form-mid layui-word-aux" id="notice">在商城首页的名家推荐显示</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="white-space: nowrap;">职位:</label>
|
||||
<div class="layui-input-inline" style="width: 400px">
|
||||
<input type="text" name="position" value="<?php echo htmlentities($info['position']); ?>" placeholder="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="white-space: nowrap;">荣誉:</label>
|
||||
<div class="layui-input-inline" style="width: 400px">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php /*a:2:{s:90:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/goods/lists.html";i:1628618358;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout1.html";i:1628618358;}*/ ?>
|
||||
<?php /*a:2:{s:90:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/goods/lists.html";i:1640504870;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout1.html";i:1628618358;}*/ ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
@ -67,9 +67,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">商品供货商:</label>
|
||||
<label class="layui-form-label">专家:</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="supplier_id" id="supplier_id" placeholder="请选择商品供货商" >
|
||||
<select name="supplier_id" id="supplier_id" placeholder="请选择专家" >
|
||||
<option value="0">全部</option>
|
||||
<?php foreach($supplier_list as $val): ?>
|
||||
<option value="<?php echo htmlentities($val['id']); ?>"><?php echo htmlentities($val['name']); ?></option>
|
||||
|
|
@ -91,13 +91,6 @@
|
|||
<button id="upper" class="layui-btn layui-btn-sm layuiadmin-btn-goods <?php echo htmlentities($view_theme_color); ?>" data-type="upper" style="display: none;">上架</button>
|
||||
</div>
|
||||
<table id="goods-lists" lay-filter="goods-lists"></table>
|
||||
<script type="text/html" id="ratio">
|
||||
<p >一级佣金:{{d.first_ratio_desc}}</p>
|
||||
<p >二级佣金:{{d.second_ratio_desc}}</p>
|
||||
<p >三级佣金:{{d.three_ratio_desc}}</p>
|
||||
<!-- <p >股东分红比例:{{d.region_ratio_desc}}</p>-->
|
||||
<!-- <p >区域分红比例:{{d.shareholder_ratio_desc}}</p>-->
|
||||
</script>
|
||||
<script type="text/html" id="new">
|
||||
<input type="checkbox" lay-filter="switch-status" data-id={{d.id}} data-field='is_new' lay-skin="switch"
|
||||
lay-text="是|否" {{# if(d.is_new){ }} checked {{# } }} />
|
||||
|
|
@ -110,6 +103,14 @@
|
|||
<input type="checkbox" lay-filter="switch-status" data-id={{d.id}} data-field='is_like' lay-skin="switch"
|
||||
lay-text="是|否" {{# if(d.is_like){ }} checked {{# } }} />
|
||||
</script>
|
||||
<script type="text/html" id="jiantreasure">
|
||||
<input type="checkbox" lay-filter="switch-status" data-id={{d.id}} data-field='is_jiantreasure' lay-skin="switch"
|
||||
lay-text="是|否" {{# if(d.is_jiantreasure){ }} checked {{# } }} />
|
||||
</script>
|
||||
<script type="text/html" id="zdtreasure">
|
||||
<input type="checkbox" lay-filter="switch-status" data-id={{d.id}} data-field='is_zdtreasure' lay-skin="switch"
|
||||
lay-text="是|否" {{# if(d.is_zdtreasure){ }} checked {{# } }} />
|
||||
</script>
|
||||
<script type="text/html" id="goods-info">
|
||||
<img src="{{d.image}}" style="height:60px;width: 60px;margin-right: 5px;" class="image-show"> {{d.name}}
|
||||
</script>
|
||||
|
|
@ -509,14 +510,14 @@
|
|||
{type: 'checkbox'}
|
||||
,{field: 'name', title: '商品名称',width:320,toolbar: '#goods-info'}
|
||||
,{field: 'cat_name',width:160, title: '商品分类'}
|
||||
,{field: 'commission_status',width:160, title: '三级分销'}
|
||||
,{field: 'ratio',width:160, title: '分销比例',toolbar: '#ratio'}
|
||||
,{field: 'price',width:180,title: '价格'}
|
||||
,{field: 'stock',width: 100,title: '总库存'}
|
||||
,{field: 'total_sales_sum',width: 100,title: '总销量'}
|
||||
,{field: 'ratio',width:160, title: '新品推荐',toolbar: '#new'}
|
||||
,{field: 'ratio',width:160, title: '好物优选',toolbar: '#best'}
|
||||
,{field: 'ratio',width:160, title: '猜你喜欢',toolbar: '#like'}
|
||||
,{field: 'ratio',width:160, title: '新品上架',toolbar: '#new'}
|
||||
,{field: 'ratio',width:160, title: '精品推荐',toolbar: '#best'}
|
||||
,{field: 'ratio',width:160, title: '今日促销',toolbar: '#like'}
|
||||
,{field: 'ratio',width:160, title: '藏品捡宝',toolbar: '#jiantreasure'}
|
||||
,{field: 'ratio',width:160, title: '镇店藏品',toolbar: '#zdtreasure'}
|
||||
,{field: 'sort',width: 80, title:'排序',event: 'tips',edit:'text',sort: true}
|
||||
,{field: 'create_time_desc',width:160, title:'发布时间'}
|
||||
,{fixed: 'right', title: '操作', align: 'center', width:300, toolbar: '#goods-operation'}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php /*a:2:{s:98:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/shop_setting/policy.html";i:1628618358;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout1.html";i:1628618358;}*/ ?>
|
||||
<?php /*a:2:{s:98:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/shop_setting/policy.html";i:1641735877;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout1.html";i:1628618358;}*/ ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
@ -43,6 +43,8 @@
|
|||
<li class="layui-this">服务协议</li>
|
||||
<li>隐私政策</li>
|
||||
<li>售后保障</li>
|
||||
<li>选择理由</li>
|
||||
<li>支付方式</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
|
|
@ -65,6 +67,20 @@
|
|||
<textarea name="after_sale" id="after_sale" lay-verify="content" class="field-content"><?php echo htmlentities($config['after_sale']); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
<label class="layui-form-label"style="white-space: nowrap;">内容:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="payment" id="payment" lay-verify="content" class="field-content"><?php echo htmlentities($config['payment']); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
<label class="layui-form-label"style="white-space: nowrap;">内容:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="reason" id="reason" lay-verify="content" class="field-content"><?php echo htmlentities($config['reason']); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
|
@ -102,12 +118,16 @@
|
|||
var service = likeedit.build('service'); //建立编辑器
|
||||
var privacy = likeedit.build('privacy'); //建立编辑器
|
||||
var after_sale = likeedit.build('after_sale'); //建立编辑器
|
||||
var payment = likeedit.build('payment'); //建立编辑器
|
||||
var reason = likeedit.build('reason'); //建立编辑器
|
||||
form.verify({
|
||||
|
||||
content: function() {
|
||||
likeedit.sync(service)
|
||||
likeedit.sync(privacy)
|
||||
likeedit.sync(after_sale)
|
||||
likeedit.sync(payment)
|
||||
likeedit.sync(reason)
|
||||
}
|
||||
})
|
||||
form.verify({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php /*a:2:{s:94:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/goods_brand/add.html";i:1628618358;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout2.html";i:1628618358;}*/ ?>
|
||||
<?php /*a:2:{s:94:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/goods_brand/add.html";i:1640335495;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout2.html";i:1628618358;}*/ ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
@ -52,27 +52,16 @@
|
|||
</style>
|
||||
<div class="layui-form" lay-filter="">
|
||||
<div class="layui-tab">
|
||||
<!--品牌名称-->
|
||||
<!--壶类型名称-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>品牌名称</label>
|
||||
<label class="layui-form-label"><font color="red">*</font>壶类型名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" lay-verify="required" lay-verType="tips" placeholder="请输入品牌名称" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="name" lay-verify="required" lay-verType="tips" placeholder="请输入壶类型名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<!--品牌首字母-->
|
||||
<!--壶类型图片-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><font color="red">*</font>品牌首字母</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="initial" id="select" >
|
||||
<?php foreach($capital as $val): ?>
|
||||
<option value="<?php echo htmlentities($val); ?>"><?php echo htmlentities($val); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!--品牌图片-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">品牌图片</label>
|
||||
<label class="layui-form-label">壶类型图片</label>
|
||||
<div class="layui-input-inline">
|
||||
<div class="img-content">
|
||||
<input name="image" type="hidden" value="">
|
||||
|
|
@ -81,11 +70,11 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--品牌排序-->
|
||||
<!--壶类型排序-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">品牌排序</label>
|
||||
<label class="layui-form-label">壶类型排序</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="sort" placeholder="请输入品牌排序" class="layui-input">
|
||||
<input type="number" name="sort" placeholder="请输入壶类型排序" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<!--是否显示-->
|
||||
|
|
@ -96,11 +85,11 @@
|
|||
<input type="radio" name="is_show" value="0" title="不显示">
|
||||
</div>
|
||||
</div>
|
||||
<!--品牌描述-->
|
||||
<!--壶类型描述-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">品牌描述</label>
|
||||
<label class="layui-form-label">壶类型描述</label>
|
||||
<div class="layui-input-inline">
|
||||
<textarea name="remark" placeholder="请输入品牌描述" class="layui-textarea"></textarea>
|
||||
<textarea name="remark" placeholder="请输入壶类型描述" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php /*a:2:{s:99:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/goods_category/lists.html";i:1628618358;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout1.html";i:1628618358;}*/ ?>
|
||||
<?php /*a:2:{s:99:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/goods_category/lists.html";i:1640500997;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout1.html";i:1628618358;}*/ ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
@ -36,8 +36,6 @@
|
|||
<div class="layui-btn-container" style="display: inline-block;">
|
||||
<div class="layui-btn-group">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-goods_category <?php echo htmlentities($view_theme_color); ?>" id="goods_category-add">添加</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-goods_category <?php echo htmlentities($view_theme_color); ?>" id="expand-all">全部展开</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-goods_category <?php echo htmlentities($view_theme_color); ?>" id="fold-all">全部折叠</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" id="search-value" placeholder="请输入" autocomplete="off" class="layui-input" style="display: inline-block;width: 140px;padding: 0 5px;margin-right: 5px;">
|
||||
|
|
@ -56,9 +54,9 @@
|
|||
</script>
|
||||
<script type="text/html" id="is_recommend">
|
||||
{{# if(d.is_recommend == 1){ }}
|
||||
推荐
|
||||
是
|
||||
{{# }else{}}
|
||||
不推荐
|
||||
否
|
||||
{{#}}}
|
||||
</script>
|
||||
<!-- 表格操作列 -->
|
||||
|
|
@ -112,7 +110,7 @@
|
|||
cols: [
|
||||
{field: 'name', title: '分类名称',width: 280},
|
||||
{field: '#image', title: '分类图标', width: 120,style:'height:100px;',toolbar: '#image', align: 'center'},
|
||||
{templet: '#is_recommend', title: '首页推荐', width: 100,align: 'center'},
|
||||
{templet: '#is_recommend', title: '惠藏百件', width: 100,align: 'center'},
|
||||
{templet: '#is_show', title: '显示', width: 100},
|
||||
{field: 'sort', title: '排序', width: 80, align: 'center',event: 'tips',sort: true},
|
||||
{fixed: 'right', align: 'center', toolbar: '#goods_category-operation', title: '操作', width: 180}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php /*a:2:{s:98:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/goods_category/edit.html";i:1628618358;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout2.html";i:1628618358;}*/ ?>
|
||||
<?php /*a:2:{s:98:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/goods_category/edit.html";i:1640500949;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout2.html";i:1628618358;}*/ ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
@ -56,23 +56,13 @@
|
|||
</style>
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-category" id="layuiadmin-form-category" style="padding: 20px 30px 0 0;">
|
||||
<input type="hidden" value="<?php echo htmlentities($info['id']); ?>" name="id">
|
||||
<input type="hidden" value="0" name="pid">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">名称:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" value="<?php echo htmlentities($info['name']); ?>" lay-verify="required" lay-verType="tips" placeholder="请输入名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">父级分类:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="pid" lay-verify="required" placeholder="请选择父级分类" lay-filter="search_pid">
|
||||
<option value="0" data-level="1">顶级分类</option>
|
||||
<?php foreach($category_list as $item => $val): ?>
|
||||
<option value="<?php echo htmlentities($item); ?>"data-level=<?php echo htmlentities($val['level']); if($info['pid'] == $item): ?> selected="selected" <?php endif; ?>><?php echo htmlentities($val['name']); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分类图标:</label>
|
||||
<div class="layui-input-inline">
|
||||
|
|
@ -99,10 +89,10 @@
|
|||
</div>
|
||||
<?php if($info['pid'] == 0): ?>
|
||||
<div class="layui-form-item is_recommend">
|
||||
<label class="layui-form-label">首页推荐:</label>
|
||||
<label class="layui-form-label">惠藏百件:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="is_recommend" value="1" title="推荐" <?php if($info['is_recommend'] == 1): ?>checked<?php endif; ?>>
|
||||
<input type="radio" name="is_recommend" value="0" title="不推荐" <?php if($info['is_recommend'] == 0): ?>checked<?php endif; ?>>
|
||||
<input type="radio" name="is_recommend" value="1" title="是" <?php if($info['is_recommend'] == 1): ?>checked<?php endif; ?>>
|
||||
<input type="radio" name="is_recommend" value="0" title="否" <?php if($info['is_recommend'] == 0): ?>checked<?php endif; ?>>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item is_recommend">
|
||||
|
|
|
|||
Loading…
Reference in New Issue