mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
CompoerUpdate
This commit is contained in:
parent
7e022bf589
commit
60a404e2ea
@ -51,8 +51,8 @@ class ShopGoods extends Controller
|
||||
elseif ($this->type === 'recycle') $query->where(['deleted' => 1]);
|
||||
else $this->error("无法加载 {$this->type} 数据列表!");
|
||||
// 列表排序并显示
|
||||
$query->like('code,name,marks,cateids')->equal('status,vip_entry,truck_type');
|
||||
$query->order('sort desc,id desc')->page();
|
||||
$query->like('code,name')->like('cate,mark', ',');
|
||||
$query->equal('status,vip_entry,truck_type')->order('sort desc,id desc')->page();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,7 +65,7 @@ class ShopGoods extends Controller
|
||||
public function select()
|
||||
{
|
||||
$query = $this->_query($this->table);
|
||||
$query->equal('status')->like('code,name,marks')->in('cates');
|
||||
$query->equal('status')->like('code,name,marks')->in('cateids');
|
||||
$query->where(['deleted' => 0])->order('sort desc,id desc')->page();
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ class ShopGoods extends Controller
|
||||
protected function _page_filter(array &$data)
|
||||
{
|
||||
$this->marks = GoodsService::instance()->getMarkData();
|
||||
$this->cates = GoodsService::instance()->getCateData();
|
||||
$this->cates = GoodsService::instance()->getCateTree('arr2table');
|
||||
GoodsService::instance()->bindData($data, false);
|
||||
}
|
||||
|
||||
|
@ -24,16 +24,17 @@ class GoodsService extends Service
|
||||
|
||||
/**
|
||||
* 获取分类数据
|
||||
* @param string $type 数据格式 arr2tree | arr2table
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getCateTree(): array
|
||||
public function getCateTree($type = 'arr2tree'): array
|
||||
{
|
||||
$map = ['deleted' => 0, 'status' => 1];
|
||||
$query = $this->app->db->name('ShopGoodsCate')->where($map)->order('sort desc,id desc');
|
||||
return DataExtend::arr2tree($query->withoutField('sort,status,deleted,create_at')->select()->toArray());
|
||||
return DataExtend::$type($query->withoutField('sort,status,deleted,create_at')->select()->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -15,37 +15,39 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{notempty name='marks'}
|
||||
<!--{notempty name='marks'}-->
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">商品标签</label>
|
||||
<label class="layui-input-inline">
|
||||
<select class="layui-select" name="mark" lay-search>
|
||||
<option value="">-- 全部标签 --</option>
|
||||
{foreach $marks as $mark}{if input('mark','') eq ','.$mark.','}
|
||||
<option selected value=",{$mark},">{$mark}</option>
|
||||
{foreach $marks as $mark}{if input('mark','') eq $mark}
|
||||
<option selected value="{$mark}">{$mark}</option>
|
||||
{else}
|
||||
<option value=",{$mark},">{$mark}</option>
|
||||
<option value="{$mark}">{$mark}</option>
|
||||
{/if}{/foreach}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
{/notempty}
|
||||
<!--{/notempty}-->
|
||||
|
||||
{notempty name='cates'}
|
||||
<!--{notempty name='cates'}-->
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">商品分类</label>
|
||||
<label class="layui-input-inline">
|
||||
<select class="layui-select" name="cateids" lay-search>
|
||||
<option value="">-- 全部分类 --</option>
|
||||
{foreach $cates as $cate}{if input('cateids','') eq ','.$cate.id.','}
|
||||
<option selected value=",{$cate.id},">{:join(' > ', $cate.names)}</option>
|
||||
{else}
|
||||
<option value=",{$cate.id},">{:join(' > ', $cate.names)}</option>
|
||||
{/if}{/foreach}
|
||||
</select>
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-input-inline">
|
||||
<select class="layui-select" name="cate" lay-search>
|
||||
<option value="">-- 全部分类 --</option>
|
||||
{foreach $cates as $cate}{if input('cate') eq $cate.id}
|
||||
<option selected value="{$cate.id}">{$cate.spl}{$cate.name|default=''}</option>
|
||||
{else}
|
||||
<option value="{$cate.id}">{$cate.spl}{$cate.name|default=''}</option>
|
||||
{/if}{/foreach}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{/notempty}
|
||||
<!--{/notempty}-->
|
||||
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">销售状态</label>
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitebdef296d7d83da818fc7b45caf0540d::getLoader();
|
||||
return ComposerAutoloaderInit6dcb8a18f830adceacf76408fbd14a53::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitebdef296d7d83da818fc7b45caf0540d
|
||||
class ComposerAutoloaderInit6dcb8a18f830adceacf76408fbd14a53
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,15 +22,15 @@ class ComposerAutoloaderInitebdef296d7d83da818fc7b45caf0540d
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitebdef296d7d83da818fc7b45caf0540d', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit6dcb8a18f830adceacf76408fbd14a53', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitebdef296d7d83da818fc7b45caf0540d', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit6dcb8a18f830adceacf76408fbd14a53', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitebdef296d7d83da818fc7b45caf0540d::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit6dcb8a18f830adceacf76408fbd14a53::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
@ -51,19 +51,19 @@ class ComposerAutoloaderInitebdef296d7d83da818fc7b45caf0540d
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitebdef296d7d83da818fc7b45caf0540d::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit6dcb8a18f830adceacf76408fbd14a53::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireebdef296d7d83da818fc7b45caf0540d($fileIdentifier, $file);
|
||||
composerRequire6dcb8a18f830adceacf76408fbd14a53($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequireebdef296d7d83da818fc7b45caf0540d($fileIdentifier, $file)
|
||||
function composerRequire6dcb8a18f830adceacf76408fbd14a53($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
10
vendor/composer/autoload_static.php
vendored
10
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitebdef296d7d83da818fc7b45caf0540d
|
||||
class ComposerStaticInit6dcb8a18f830adceacf76408fbd14a53
|
||||
{
|
||||
public static $files = array (
|
||||
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
||||
@ -682,10 +682,10 @@ class ComposerStaticInitebdef296d7d83da818fc7b45caf0540d
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitebdef296d7d83da818fc7b45caf0540d::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitebdef296d7d83da818fc7b45caf0540d::$prefixDirsPsr4;
|
||||
$loader->fallbackDirsPsr0 = ComposerStaticInitebdef296d7d83da818fc7b45caf0540d::$fallbackDirsPsr0;
|
||||
$loader->classMap = ComposerStaticInitebdef296d7d83da818fc7b45caf0540d::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit6dcb8a18f830adceacf76408fbd14a53::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit6dcb8a18f830adceacf76408fbd14a53::$prefixDirsPsr4;
|
||||
$loader->fallbackDirsPsr0 = ComposerStaticInit6dcb8a18f830adceacf76408fbd14a53::$fallbackDirsPsr0;
|
||||
$loader->classMap = ComposerStaticInit6dcb8a18f830adceacf76408fbd14a53::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// This file is automatically generated at:2021-03-20 14:21:24
|
||||
// This file is automatically generated at:2021-03-20 17:50:03
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
0 => 'think\\admin\\Library',
|
||||
|
Loading…
x
Reference in New Issue
Block a user