Browse Source

feat: 基础模块的页面和菜单模板创建

wechat_public_accounts
root 5 years ago
parent
commit
1bb456d7b8
  1. 2
      .gitignore
  2. 6
      backend/assets/AppAsset.php
  3. 6
      backend/controllers/AttributeController.php
  4. 76
      backend/controllers/ConfigController.php
  5. 129
      backend/controllers/OrderController.php
  6. 4
      backend/controllers/ShopCategoryController.php
  7. 0
      backend/controllers/SiteController.php
  8. 0
      backend/runtime/.gitignore
  9. 10
      backend/views/attribute/_search.php
  10. 6
      backend/views/attribute/index.php
  11. 8
      backend/views/category/_search.php
  12. 4
      backend/views/category/index.php
  13. 27
      backend/views/config/index.php
  14. 8
      backend/views/goods/_search.php
  15. 4
      backend/views/goods/index.php
  16. 2
      backend/views/layouts/base.php
  17. 26
      backend/views/layouts/breadcrumb.php
  18. 0
      backend/views/layouts/footer.php
  19. 93
      backend/views/layouts/header.php
  20. 4
      backend/views/layouts/main.php
  21. 34
      backend/views/layouts/sidebar.php
  22. 68
      backend/views/order/_form.php
  23. 20
      backend/views/order/_search.php
  24. 18
      backend/views/order/create.php
  25. 28
      backend/views/order/index.php
  26. 19
      backend/views/order/update.php
  27. 52
      backend/views/order/view.php
  28. 0
      backend/views/shop-category/_form.php
  29. 8
      backend/views/shop-category/_search.php
  30. 0
      backend/views/shop-category/create.php
  31. 6
      backend/views/shop-category/index.php
  32. 0
      backend/views/shop-category/update.php
  33. 0
      backend/views/shop-category/view.php
  34. 0
      backend/views/site/error.php
  35. 0
      backend/views/site/index.php
  36. 2
      backend/views/site/login.php
  37. 0
      backend/views/site/test.php
  38. 0
      backend/web/assets/.gitignore
  39. 6
      common/config/main.php
  40. 58
      common/models/ars/Config.php
  41. 4
      common/models/searchs/AttributeSearch.php
  42. 183
      common/models/searchs/OrderSearch.php
  43. 2
      composer.json
  44. 64
      composer.lock
  45. 26
      kcadmin/assets/AppAsset.php
  46. 4
      kcadmin/config/.gitignore
  47. 1
      kcadmin/config/bootstrap.php
  48. 46
      kcadmin/config/main.php
  49. 4
      kcadmin/config/params.php
  50. 112
      kcadmin/controllers/SiteController.php
  51. 1
      kcadmin/models/.gitkeep
  52. 43
      kcadmin/views/category/_form.php
  53. 21
      kcadmin/views/category/create.php
  54. 35
      kcadmin/views/category/index.php
  55. 98
      kcadmin/views/category/test.php
  56. 24
      kcadmin/views/category/update.php
  57. 43
      kcadmin/views/category/view.php
  58. 33
      kcadmin/views/layouts/base.php
  59. 25
      kcadmin/views/layouts/breadcrumb.php
  60. 7
      kcadmin/views/layouts/footer.php
  61. 67
      kcadmin/views/layouts/header.php
  62. 43
      kcadmin/views/layouts/main.php
  63. 32
      kcadmin/views/layouts/sidebar.php
  64. 27
      kcadmin/views/site/error.php
  65. 6
      kcadmin/views/site/index.php
  66. 34
      kcadmin/views/site/login.php
  67. 68
      kcadmin/views/site/test.php
  68. 2
      kcadmin/web/assets/.gitignore
  69. 48
      kcadmin/web/css/reset.css
  70. 52
      kcadmin/web/css/site.css
  71. BIN
      kcadmin/web/favicon.ico
  72. BIN
      kcadmin/web/img/avatar.png
  73. BIN
      kcadmin/web/img/avatar04.png
  74. BIN
      kcadmin/web/img/avatar2.png
  75. BIN
      kcadmin/web/img/avatar3.png
  76. BIN
      kcadmin/web/img/avatar5.png
  77. BIN
      kcadmin/web/img/credit/american-express.png
  78. BIN
      kcadmin/web/img/credit/cirrus.png
  79. BIN
      kcadmin/web/img/credit/mastercard.png
  80. BIN
      kcadmin/web/img/credit/mestro.png
  81. BIN
      kcadmin/web/img/credit/paypal.png
  82. BIN
      kcadmin/web/img/credit/paypal2.png
  83. BIN
      kcadmin/web/img/credit/visa.png
  84. BIN
      kcadmin/web/img/default-50x50.gif
  85. BIN
      kcadmin/web/img/icons.png
  86. BIN
      kcadmin/web/img/logo.jpeg
  87. BIN
      kcadmin/web/img/photo1.png
  88. BIN
      kcadmin/web/img/photo2.png
  89. BIN
      kcadmin/web/img/photo3.jpg
  90. BIN
      kcadmin/web/img/photo4.jpg
  91. BIN
      kcadmin/web/img/user1-128x128.jpg
  92. BIN
      kcadmin/web/img/user2-160x160.jpg
  93. BIN
      kcadmin/web/img/user3-128x128.jpg
  94. BIN
      kcadmin/web/img/user4-128x128.jpg
  95. BIN
      kcadmin/web/img/user5-128x128.jpg
  96. BIN
      kcadmin/web/img/user6-128x128.jpg
  97. BIN
      kcadmin/web/img/user7-128x128.jpg
  98. BIN
      kcadmin/web/img/user8-128x128.jpg
  99. 20
      kcadmin/web/index.php
  100. 0
      kcadmin/web/js/common.js

2
.gitignore

@ -36,4 +36,4 @@ phpunit.phar
/.vagrant
vendor.zip
/vagrant
/kcadmin/web/uploads
/backend/web/uploads

6
backend/assets/AppAsset.php

@ -19,8 +19,8 @@ class AppAsset extends AssetBundle
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'yii\bootstrap\BootstrapPluginAsset',
'blobt\web\AdminlteAsset',
'yii\bootstrap4\BootstrapAsset',
'yii\bootstrap4\BootstrapPluginAsset',
'iron\web\AdminlteAsset',
];
}

6
backend/controllers/AttributeController.php

@ -2,6 +2,7 @@
namespace backend\controllers;
use common\models\ars\Config;
use Yii;
use common\models\ars\Attribute;
use common\models\searchs\AttributeSearch;
@ -125,13 +126,14 @@ class AttributeController extends Controller
throw new NotFoundHttpException('The requested page does not exist.');
}
/**
* @author iron
* 文件导出
*/
public function actionExport()
{
$searchModel = new AttributeSearch();
$searchModel = new attributeSearch();
$params = Yii::$app->request->queryParams;
if ($params['page-type'] == 'all') {
$dataProvider = $searchModel->allData($params);
@ -142,7 +144,7 @@ class AttributeController extends Controller
'models' => $dataProvider->getModels(),
'format' => 'Xlsx',
'asAttachment' => true,
'fileName' =>'Attributes'. "-" .date('Y-m-d H/i/s', time()),
'fileName' => 'Attributes' . "-" . date('Y-m-d H/i/s', time()),
'columns' => $searchModel->columns()
]);
}

76
backend/controllers/ConfigController.php

@ -0,0 +1,76 @@
<?php
namespace backend\controllers;
use Yii;
use common\models\ars\Category;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* CategoryController implements the CRUD actions for Category model.
*/
class ConfigController extends Controller
{
/**
* {@inheritdoc}
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all Category models.
* @return mixed
*/
public function actionIndex()
{
return $this->render('index');
}
/**
* Updates an existing Category model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
* @throws NotFoundHttpException if the model cannot be found
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect('index');
}
return $this->render('update', [
'model' => $model,
]);
}
/**
* Finds the Category model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Category the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Category::findOne($id)) !== null) {
return $model;
}
throw new NotFoundHttpException('The requested page does not exist.');
}
}

kcadmin/controllers/CategoryController.php → backend/controllers/OrderController.php

backend/controllers/ShopcategoryController.php → backend/controllers/ShopCategoryController.php

0
backend/controllers/SiteController.php

kcadmin/runtime/.gitignore → backend/runtime/.gitignore

10
backend/views/attribute/_search.php

@ -5,7 +5,7 @@ use yii\widgets\ActiveForm;
use \blobt\widgets\DateRangePicker;
/* @var $this yii\web\View */
/* @var $model common\models\searchs\AttributeSearch */
/* @var $model common\models\searchs\attributeSearch */
/* @var $form yii\widgets\ActiveForm */
?>
@ -15,8 +15,8 @@ use \blobt\widgets\DateRangePicker;
'validateOnType' => true,
]);
?>
<div class="col-sm-12">
<div class="dataTables_filter">
<div class="row">
<div class="col">
<?= $form->field($model, 'id', [
"template" => "{input}{error}",
"inputOptions" => [
@ -28,6 +28,8 @@ use \blobt\widgets\DateRangePicker;
]
])
?>
</div>
<div class="col">
<?= $form->field($model, "created_at_range", [
"template" => "{input}{error}",
"inputOptions" => [
@ -38,10 +40,10 @@ use \blobt\widgets\DateRangePicker;
]
])->widget(DateRangePicker::className());
?>
</div>
<div class="form-group">
<?= Html::submitButton('<i class="fa fa-filter"></i>', ['class' => 'btn btn-default']) ?>
<?= Html::resetButton('<i class="fa fa-eraser"></i>', ['class' => 'btn btn-default']) ?>
</div>
</div>
</div>
<?php ActiveForm::end(); ?>

6
backend/views/attribute/index.php

@ -1,17 +1,17 @@
<?php
use yii\helpers\Html;
use blobt\grid\GridView;
use iron\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\AttributeSearch */
/* @var $searchModel common\models\searchs\attributeSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Attributes';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
<div class="col-xs-12">
<div class="col-12">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filter' => $this->render("_search", ['model' => $searchModel]),

8
backend/views/category/_search.php

@ -15,8 +15,8 @@ use \blobt\widgets\DateRangePicker;
'validateOnType' => true,
]);
?>
<div class="col-sm-12">
<div class="dataTables_filter">
<div class="row">
<div class="col">
<?= $form->field($model, 'id', [
"template" => "{input}{error}",
"inputOptions" => [
@ -28,6 +28,8 @@ use \blobt\widgets\DateRangePicker;
]
])
?>
</div>
<div class="col">
<?= $form->field($model, "created_at_range", [
"template" => "{input}{error}",
"inputOptions" => [
@ -38,10 +40,10 @@ use \blobt\widgets\DateRangePicker;
]
])->widget(DateRangePicker::className());
?>
</div>
<div class="form-group">
<?= Html::submitButton('<i class="fa fa-filter"></i>', ['class' => 'btn btn-default']) ?>
<?= Html::resetButton('<i class="fa fa-eraser"></i>', ['class' => 'btn btn-default']) ?>
</div>
</div>
</div>
<?php ActiveForm::end(); ?>

4
backend/views/category/index.php

@ -1,7 +1,7 @@
<?php
use yii\helpers\Html;
use blobt\grid\GridView;
use iron\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\CategorySearch */
@ -11,7 +11,7 @@ $this->title = 'Categories';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
<div class="col-xs-12">
<div class="col-12">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filter' => $this->render("_search", ['model' => $searchModel]),

27
backend/views/config/index.php

@ -0,0 +1,27 @@
<?php
/*
* The MIT License
*
* Copyright 2019 Blobt.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
?>
配置页

8
backend/views/goods/_search.php

@ -15,8 +15,8 @@ use \blobt\widgets\DateRangePicker;
'validateOnType' => true,
]);
?>
<div class="col-sm-12">
<div class="dataTables_filter">
<div class="row">
<div class="col">
<?= $form->field($model, 'id', [
"template" => "{input}{error}",
"inputOptions" => [
@ -28,6 +28,8 @@ use \blobt\widgets\DateRangePicker;
]
])
?>
</div>
<div class="col">
<?= $form->field($model, "created_at_range", [
"template" => "{input}{error}",
"inputOptions" => [
@ -38,10 +40,10 @@ use \blobt\widgets\DateRangePicker;
]
])->widget(DateRangePicker::className());
?>
</div>
<div class="form-group">
<?= Html::submitButton('<i class="fa fa-filter"></i>', ['class' => 'btn btn-default']) ?>
<?= Html::resetButton('<i class="fa fa-eraser"></i>', ['class' => 'btn btn-default']) ?>
</div>
</div>
</div>
<?php ActiveForm::end(); ?>

4
backend/views/goods/index.php

@ -1,7 +1,7 @@
<?php
use yii\helpers\Html;
use blobt\grid\GridView;
use iron\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\GoodsSearch */
@ -11,7 +11,7 @@ $this->title = 'Goods';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
<div class="col-xs-12">
<div class="col-12">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filter' => $this->render("_search", ['model' => $searchModel]),

2
backend/views/layouts/base.php

@ -2,7 +2,7 @@
/* @var $this \yii\web\View */
/* @var $content string */
use kcadmin\assets\AppAsset;
use backend\assets\AppAsset;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;

26
backend/views/layouts/breadcrumb.php

@ -1,13 +1,25 @@
<?PHP
use yii\widgets\Breadcrumbs;
?>
<?php if (!empty($this->title)): ?>
<h1><?= $this->title ?><?php if (isset($this->params['subtitle'])): ?><small><?= $this->params['subtitle'] ?></small><?php endif ?></h1>
<?php endif ?>
<?php
echo Breadcrumbs::widget([
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<?php if (!empty($this->title)): ?>
<h1><?= $this->title ?><?php if (isset($this->params['subtitle'])): ?>
<small><?= $this->params['subtitle'] ?></small><?php endif ?></h1>
<?php endif ?>
</div>
<div class="col-sm-6">
<?php
echo Breadcrumbs::widget([
'tag' => 'ol',
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]);
?>
'itemTemplate' => "<li class='breadcrumb-item'>{link}</li>\n",
'activeItemTemplate' => "<li class=\"breadcrumb-item active\">{link}</li>\n",
'options' => ['class' => 'breadcrumb float-sm-right']
]);
?>
</div>
</div>

0
backend/views/layouts/footer.php

93
backend/views/layouts/header.php

@ -1,71 +1,49 @@
<?php
use yii\helpers\Html;
?>
<header class="main-header">
<!-- Logo -->
<a href="/" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>K</b>c</span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg"><b>KC</b>admin</span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top">
<div class="navbar-menu">
<ul class="nav navbar-nav">
<li>
<!-- Sidebar toggle button-->
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<header>
<div class="wrapper">
<!-- Navbar -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
</li>
<!-- TODO:后续处理 -->
<!--li class="user user-menu">
<a href="#">
<i class="fa fa-dashboard"></i>
<span class="hidden-xs">面板</span>
</a>
<li class="nav-item d-none d-sm-inline-block">
<a href="#" class="nav-link">Home</a>
</li>
<li class="user user-menu">
<a href="#">
<i class="fa fa-shopping-cart"></i>
<span class="hidden-xs">商城</span>
</a>
</li>
<li class="user user-menu">
<a href="#">
<i class="fa fa-wechat"></i>
<span class="hidden-xs">微信</span>
</a>
</li>
<li class="user user-menu">
<a href="#">
<i class="fa fa-cubes"></i>
<span class="hidden-xs">进销存</span>
</a>
</li>
<li class="user user-menu">
<a href="#">
<i class="fa fa-cogs"></i>
<span class="hidden-xs">系统</span>
</a>
</li-->
</ul>
</div>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="/img/user2-160x160.jpg" class="user-image" alt="User Image">
<span class="hidden-xs"><?= yii::$app->user->identity->username ?></span>
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
<!-- Messages Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="far fa-comments"></i>
<span class="badge badge-danger navbar-badge">3</span>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<div class="dropdown-divider"></div>
<div class="dropdown-divider"></div>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item dropdown-footer">See All Messages</a>
</div>
</li>
<!-- Notifications Dropdown Menu -->
<li class="nav-item user-menu ">
<a href="#" class="nav-link" data-toggle="dropdown">
<i class="fas fa-th-large"></i>
<!-- <img src="/img/user2-160x160.jpg" class="user-image" alt="User Image">-->
<!-- <span class="hidden-xs">-->
<? //= yii::$app->user->identity->username ?><!--</span>-->
</a>
<ul class="dropdown-menu">
<ul class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<!-- User image -->
<li class="user-header">
<img src="/img/user2-160x160.jpg" class="img-circle" alt="User Image">
<p>
<?= yii::$app->user->identity->username ?>
<small>Member since <?= date('m-d-Y', yii::$app->user->identity->created_at) ?></small>
@ -81,8 +59,9 @@ use yii\helpers\Html;
</div>
</li>
</ul>
<!-- <a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#"><i-->
<!-- class="fas fa-th-large"></i></a>-->
</li>
</ul>
</div>
</nav>
</header>

4
backend/views/layouts/main.php

@ -2,10 +2,8 @@
/* @var $this \yii\web\View */
/* @var $content string */
use kcadmin\assets\AppAsset;
use backend\assets\AppAsset;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
AppAsset::register($this);

34
backend/views/layouts/sidebar.php

@ -1,28 +1,36 @@
<?php
use blobt\widgets\Menu;
use iron\widgets\Menu;
?>
<aside class="main-sidebar">
<aside class="main-sidebar sidebar-dark-info elevation-4">
<a href="#" class="brand-link">
<img src="/img/logo.jpeg" alt="AdminLTE" class="brand-image img-circle elevation-3"
style="opacity: .8">
<span class="brand-text font-weight-light">AdminLTE 3</span>
</a>
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<?php
echo Menu::widget([
'items' => [
['label' => 'MAIN NAVIGATION', 'is_header' => true],
['label' => 'IndexController', 'url' => '#', 'icon' => 'fa-hand-o-right', 'items' => [
['label' => 'Index', 'url' => ['site/index', 'tag' => 'new']],
['label' => 'Test', 'url' => ['site/test']],
// ['label' => 'MAIN NAVIGATION', 'is_header' => true],
['label' => '商城管理', 'url' => '#', 'icon' => 'far fa-store', 'items' => [
['label' => '运营数据', 'url' => ['site/index', 'tag' => 'new']],
['label' => '基础配置', 'url' => ['config/index', 'tag' => 'new']],
]
],
['label' => '商品管理', 'url' => '#', 'icon' => 'fa-barcode', 'items' => [
['label' => '前端商品分类管理', 'url' => ['shopcategory/index', 'tag' => 'new']],
['label' => '后台商品分类管理', 'url' => ['category/index', 'tag' => 'popular']],
['label' => '商品管理', 'url' => ['goods/index', 'tag' => 'popular']],
['label' => '规格管理', 'url' => ['attribute/index', 'tag' => 'popular']],
['label' => '品牌管理', 'url' => ['brand/index', 'tag' => 'popular']],
['label' => '供应商管理', 'url' => ['supplier/index', 'tag' => 'popular']]
['label' => '商品管理', 'url' => '#', 'icon' => 'far fa-archive', 'items' => [
['label' => '商品分类', 'url' => ['category/index', 'tag' => 'new']],
['label' => '商品列表', 'url' => ['goods/index']],
['label' => '属性管理', 'url' => ['attribute/index']],
]
],
['label' => '订单管理', 'url' => '#', 'icon' => 'far fa-list-alt', 'items' => [
['label' => '订单列表', 'url' => ['order/index', 'tag' => 'new']],
]
],
]
]);
?>

68
backend/views/order/_form.php

@ -0,0 +1,68 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="order-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'user_id')->textInput() ?>
<?= $form->field($model, 'order_sn')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'invoice_id')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'status')->textInput() ?>
<?= $form->field($model, 'type')->textInput() ?>
<?= $form->field($model, 'goods_count')->textInput() ?>
<?= $form->field($model, 'goods_amount')->textInput() ?>
<?= $form->field($model, 'shipping_amount')->textInput() ?>
<?= $form->field($model, 'shipping_type')->textInput() ?>
<?= $form->field($model, 'consignee')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'province')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'city')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'area')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'taking_site')->textInput() ?>
<?= $form->field($model, 'pay_type')->textInput() ?>
<?= $form->field($model, 'pay_at')->textInput() ?>
<?= $form->field($model, 'payment_sn')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'payment_amount')->textInput() ?>
<?= $form->field($model, 'receivables')->textInput() ?>
<?= $form->field($model, 'remarks')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'discount_amount')->textInput() ?>
<?= $form->field($model, 'discount_decription')->textarea(['rows' => 6]) ?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
<?= Html::a('返回', ['index'], ['class' => 'btn btn-info']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

kcadmin/views/category/_search.php → backend/views/order/_search.php

18
backend/views/order/create.php

@ -0,0 +1,18 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
$this->title = '创建 Order';
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="order-create">
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

28
backend/views/order/index.php

@ -0,0 +1,28 @@
<?php
use yii\helpers\Html;
use iron\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\OrderSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Orders';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
<div class="col-12">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filter' => $this->render("_search", ['model' => $searchModel]),
'batch' => [
[
"label" => "删除",
"url" => "order/deletes"
],
],
'columns' => $columns
]);
?>
</div>
</div>

19
backend/views/order/update.php

@ -0,0 +1,19 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
$this->title = '编辑 Order: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update ';
?>
<div class="order-update">
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

52
backend/views/order/view.php

@ -0,0 +1,52 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
?>
<div class="order-view">
<p>
<?= Html::a('返回列表', ['index'], ['class' => 'btn btn-success']) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'user_id',
'order_sn',
'invoice_id',
'status',
'type',
'goods_count',
'goods_amount',
'shipping_amount',
'shipping_type',
'consignee',
'phone',
'province',
'city',
'area',
'taking_site',
'pay_type',
'pay_at',
'payment_sn',
'payment_amount',
'receivables',
'remarks',
'discount_amount',
'discount_decription:ntext',
'updated_at',
'created_at',
],
]) ?>
</div>

backend/views/shopcategory/_form.php → backend/views/shop-category/_form.php

backend/views/shopcategory/_search.php → backend/views/shop-category/_search.php

backend/views/shopcategory/create.php → backend/views/shop-category/create.php

backend/views/shopcategory/index.php → backend/views/shop-category/index.php

backend/views/shopcategory/update.php → backend/views/shop-category/update.php

backend/views/shopcategory/view.php → backend/views/shop-category/view.php

0
backend/views/site/error.php

0
backend/views/site/index.php

2
backend/views/site/login.php

@ -4,7 +4,7 @@
/* @var $model \common\models\LoginForm */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\bootstrap4\ActiveForm;
$this->title = '系统登录';
$this->params['breadcrumbs'][] = $this->title;

0
backend/views/site/test.php

0
backend/web/assets/.gitignore

6
common/config/main.php

@ -24,5 +24,11 @@ return [
'thousandSeparator' => ' ',
'currencyCode' => 'RMB',
],
'redis' => [
'class' => 'yii\redis\Connection',
'hostname' => 'localhost',
'port' => 6379,
'database' => 0,
],
],
];

58
common/models/ars/Config.php

@ -0,0 +1,58 @@
<?php
/*
* The MIT License
*
* Copyright 2019 Blobt.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
namespace common\models\ars;
use yii\redis\ActiveRecord;
/**
* @author iron
* @email weiriron@gmail.com
*
* @property int $id
* @property int $shop_logo
* @property string $shop_name
* @property string $shop_description
* @property string $copyright_info
* @property int $stock_warn
* @property int $auto_confirm_taking
* @property int $auto_cancel_order
*/
class Config extends ActiveRecord
{
public static function primaryKey()
{
return ['id'];
}
public function attributes()
{
return [
'id', 'shop_name','shop_logo', 'shop_description', 'copyright_info', 'stock_warn', 'auto_confirm_taking', 'auto_cancel_order', 'after_safe_limit_at'
];
}
}

4
common/models/searchs/AttributeSearch.php

@ -8,9 +8,9 @@ use yii\helpers\ArrayHelper;
use common\models\ars\Attribute;
/**
* AttributeSearch represents the model behind the search form of `common\models\ars\Attribute`.
* attributeSearch represents the model behind the search form of `common\models\ars\Attribute`.
*/
class AttributeSearch extends Attribute
class attributeSearch extends Attribute
{
/**
* @return array

183
common/models/searchs/OrderSearch.php

@ -0,0 +1,183 @@
<?php
namespace common\models\searchs;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use yii\helpers\ArrayHelper;
use common\models\ars\Order;
/**
* OrderSearch represents the model behind the search form of `common\models\ars\Order`.
*/
class OrderSearch extends Order
{
/**
* @return array
* 增加创建时间查询字段
*/
public function attributes()
{
return ArrayHelper::merge(['created_at_range'], parent::attributes());
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['id', 'user_id', 'status', 'type', 'goods_count', 'goods_amount', 'shipping_amount', 'shipping_type', 'taking_site', 'pay_type', 'pay_at', 'payment_amount', 'receivables', 'discount_amount', 'updated_at', 'created_at'], 'integer'],
[['order_sn', 'invoice_id', 'consignee', 'phone', 'province', 'city', 'area', 'payment_sn', 'remarks', 'discount_decription'], 'safe'],
['created_at_range','safe'],
];
}
/**
* {@inheritdoc}
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* @return array
* 列格式
*/
public function columns()
{
return [
[
'class' => 'blobt\grid\CheckboxColumn',
'width' => '2%',
'align' => 'center'
],
'id',
'user_id',
'order_sn',
'invoice_id',
'status',
//'type',
//'goods_count',
//'goods_amount',
//'shipping_amount',
//'shipping_type',
//'consignee',
//'phone',
//'province',
//'city',
//'area',
//'taking_site',
//'pay_type',
//'pay_at',
//'payment_sn',
//'payment_amount',
//'receivables',
//'remarks',
//'discount_amount',
//'discount_decription',
//'updated_at',
//'created_at',
[
'class' => 'iron\grid\ActionColumn',
'align' => 'center',
],
];
}
/**
* @param $params
* @return ActiveDataProvider
* 不分页的所有数据
*/
public function allData($params)
{
$query = Order::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => false,
'sort' => false
]);
$this->load($params);
return $this->filter($query, $dataProvider);
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Order::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSizeLimit' => [1, 200]
],
'sort' => [
'defaultOrder' => [
'id' => SORT_DESC,
]
],
]);
$this->load($params);
return $this->filter($query, $dataProvider);
}
/**
* @param $query
* @param $dataProvider
* @return ActiveDataProvider
* 条件筛选
*/
private function filter($query, $dataProvider){
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'user_id' => $this->user_id,
'status' => $this->status,
'type' => $this->type,
'goods_count' => $this->goods_count,
'goods_amount' => $this->goods_amount,
'shipping_amount' => $this->shipping_amount,
'shipping_type' => $this->shipping_type,
'taking_site' => $this->taking_site,
'pay_type' => $this->pay_type,
'pay_at' => $this->pay_at,
'payment_amount' => $this->payment_amount,
'receivables' => $this->receivables,
'discount_amount' => $this->discount_amount,
'updated_at' => $this->updated_at,
'created_at' => $this->created_at,
]);
$query->andFilterWhere(['like', 'order_sn', $this->order_sn])
->andFilterWhere(['like', 'invoice_id', $this->invoice_id])
->andFilterWhere(['like', 'consignee', $this->consignee])
->andFilterWhere(['like', 'phone', $this->phone])
->andFilterWhere(['like', 'province', $this->province])
->andFilterWhere(['like', 'city', $this->city])
->andFilterWhere(['like', 'area', $this->area])
->andFilterWhere(['like', 'payment_sn', $this->payment_sn])
->andFilterWhere(['like', 'remarks', $this->remarks])
->andFilterWhere(['like', 'discount_decription', $this->discount_decription]);
if ($this->created_at_range) {
$arr = explode(' ~ ', $this->created_at_range);
$start = strtotime($arr[0]);
$end = strtotime($arr[1]) + 3600 * 24;
$query->andFilterWhere(['between', 'created_at', $start, $end]);
}
return $dataProvider;
}
}

2
composer.json

@ -14,6 +14,7 @@
"php": ">=7.1.0",
"yiisoft/yii2": "~2.0.14",
"yiisoft/yii2-bootstrap4": "~2.0.6",
"yiisoft/yii2-redis": "^2.0.0",
"moonlandsoft/yii2-phpexcel": "*"
},
"repositories": {
@ -25,7 +26,6 @@
"type": "composer",
"url": "https://packagist.kcshop.com.cn/"
},
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"

64
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "0b877f5de588db414192c9663665b6d1",
"content-hash": "2c9d2c75498023f08e9c4155af6cb5d4",
"packages": [
{
"name": "bower-asset/inputmask",
@ -499,12 +499,12 @@
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "75dfcb5a364a33ecc1f7e57e636dda86c617aa78"
"reference": "6a2e0cef4390c62e9847eaa09b1a2b48297d5651"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/75dfcb5a364a33ecc1f7e57e636dda86c617aa78",
"reference": "75dfcb5a364a33ecc1f7e57e636dda86c617aa78",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/6a2e0cef4390c62e9847eaa09b1a2b48297d5651",
"reference": "6a2e0cef4390c62e9847eaa09b1a2b48297d5651",
"shasum": ""
},
"require": {
@ -550,7 +550,7 @@
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
"MIT"
],
"authors": [
{
@ -584,7 +584,7 @@
"xls",
"xlsx"
],
"time": "2019-11-10T21:59:09+00:00"
"time": "2019-11-17T20:53:09+00:00"
},
{
"name": "psr/simple-cache",
@ -857,6 +857,58 @@
"yii2"
],
"time": "2019-07-16T13:22:50+00:00"
},
{
"name": "yiisoft/yii2-redis",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/yiisoft/yii2-redis.git",
"reference": "7d354043f1427e473bafa8e0626a7ff3ade95e6b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yiisoft/yii2-redis/zipball/7d354043f1427e473bafa8e0626a7ff3ade95e6b",
"reference": "7d354043f1427e473bafa8e0626a7ff3ade95e6b",
"shasum": ""
},
"require": {
"yiisoft/yii2": "~2.0.14"
},
"require-dev": {
"phpunit/phpunit": "<7",
"yiisoft/yii2-dev": "~2.0.14"
},
"type": "yii2-extension",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"yii\\redis\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Carsten Brandt",
"email": "mail@cebe.cc"
}
],
"description": "Redis Cache, Session and ActiveRecord for the Yii framework",
"keywords": [
"active-record",
"cache",
"redis",
"session",
"yii2"
],
"time": "2019-11-05T14:59:07+00:00"
}
],
"packages-dev": [

26
kcadmin/assets/AppAsset.php

@ -1,26 +0,0 @@
<?php
namespace kcadmin\assets;
use yii\web\AssetBundle;
/**
* Main backend application asset bundle.
*/
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/site.css',
];
public $js = [
'js/common.js'
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap4\BootstrapAsset',
'yii\bootstrap4\BootstrapPluginAsset',
'iron\web\AdminlteAsset',
];
}

4
kcadmin/config/.gitignore

@ -1,4 +0,0 @@
codeception-local.php
main-local.php
params-local.php
test-local.php

1
kcadmin/config/bootstrap.php

@ -1 +0,0 @@
<?php

46
kcadmin/config/main.php

@ -1,46 +0,0 @@
<?php
$params = array_merge(
require __DIR__ . '/../../common/config/params.php', require __DIR__ . '/../../common/config/params-local.php', require __DIR__ . '/params.php', require __DIR__ . '/params-local.php'
);
return [
'id' => 'kcadmin',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'kcadmin\controllers',
'bootstrap' => ['log'],
'modules' => [],
'components' => [
'request' => [
'csrfParam' => '_csrf-kcadmin',
],
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
'identityCookie' => ['name' => '_identity-kcadmin', 'httpOnly' => true],
],
'session' => [
// this is the name of the session cookie used for login on the app
'name' => 'kcadmin',
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
],
'params' => $params,
];

4
kcadmin/config/params.php

@ -1,4 +0,0 @@
<?php
return [
'adminEmail' => 'admin@example.com',
];

112
kcadmin/controllers/SiteController.php

@ -1,112 +0,0 @@
<?php
namespace kcadmin\controllers;
use Yii;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use common\models\LoginForm;
use common\models\CategorySearch;
/**
* Site controller
*/
class SiteController extends Controller {
/**
* {@inheritdoc}
*/
public function behaviors() {
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['login', 'error', 'test'],
'allow' => true,
],
[
'actions' => ['logout', 'index'],
'allow' => true,
'roles' => ['@'],
],
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
// 'logout' => ['post'],
],
],
];
}
/**
* {@inheritdoc}
*/
public function actions() {
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
'upload'=>[
'class'=>'iron\actions\UploadAction',
]
];
}
/**
* Displays homepage.
*
* @return string
*/
public function actionIndex() {
return $this->render('index');
}
/**
* Login action.
*
* @return string
*/
public function actionLogin() {
$this->layout = 'base';
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
} else {
$model->password = '';
return $this->render('login', [
'model' => $model,
]);
}
}
/**
* Logout action.
*
* @return string
*/
public function actionLogout() {
Yii::$app->user->logout();
return $this->goHome();
}
public function actionTest() {
$searchModel = new CategorySearch();
return $this->render('test', [
'name' => 'blobt',
'model' => $searchModel
]);
}
}

1
kcadmin/models/.gitkeep

@ -1 +0,0 @@
*

43
kcadmin/views/category/_form.php

@ -1,43 +0,0 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use blobt\widgets\DatePicker;
use blobt\widgets\Select2;
use blobt\widgets\DatetimePicker;
use blobt\widgets\Icheck;
/* @var $this yii\web\View */
/* @var $model common\models\Category */
/* @var $form yii\widgets\ActiveForm */
?>
<?php $form = ActiveForm::begin(); ?>
<div class="box-body">
<?= $form->field($model, 'cat_name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'icon')->textInput(['maxlength' => true]) ?>
<?php //$form->field($model, 'icon_type')->widget(Select2::className(), ["items" => $model::$iconType, "promptText" => false]) ?>
<?= $form->field($model, 'icon_type')->widget(Icheck::className(), ["items" => $model::$iconType, 'type' => "radio"]) ?>
<?= $form->field($model, 'description')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'sort_order')->widget(\iron\widgets\Upload::className(), [
'url' => 'upload',
'deleteUrl' => 'imageDel',
'dragdropWidth'=> 800
]) ?>
<?= $form->field($model, 'created_at')->widget(DatetimePicker::className()) ?>
</div>
<div class="box-footer">
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>

21
kcadmin/views/category/create.php

@ -1,21 +0,0 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Category */
$this->title = 'Create Category';
$this->params['breadcrumbs'][] = ['label' => 'Categories', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><?= Html::encode($this->title) ?></h3>
</div>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

35
kcadmin/views/category/index.php

@ -1,35 +0,0 @@
<?php
use yii\helpers\Html;
use iron\grid\GridView;
//use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\CategorySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Categories';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
<div class="col-12">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filter' => $this->render("_search", ['model' => $searchModel]),
'batch' => [
[
"label" => "删除",
"url" => "/category/deletes"
],
[
"label" => "其它操作",
"url" => "/category/others"
],
],
'columns' => $columns
]);
?>
</div>
</div>

98
kcadmin/views/category/test.php

@ -1,98 +0,0 @@
<?php
/*
* The MIT License
*
* Copyright 2019 Blobt.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
?>
<header>
<link href="http://hayageek.github.io/jQuery-Upload-File/4.0.11/uploadfile.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://hayageek.github.io/jQuery-Upload-File/4.0.11/jquery.uploadfile.min.js"></script>
</header>
<body>
<div id="showoldupload">
<div class="ajax-upload-dragdrop" style="vertical-align: top; width: 600px;">
<div class="ajax-file-upload" style="position: relative; overflow: hidden; cursor: default;">Upload
<form method="POST" action="upload.php" enctype="multipart/form-data" style="margin: 0px; padding: 0px;">
<input type="file" id="ajax-upload-id-1573635462220" name="myfile[]" accept="*" multiple=""
style="position: absolute; cursor: pointer; top: 0px; width: 100%; height: 100%; left: 0px; z-index: 100; opacity: 0;">
</form>
</div>
<span><b>Drag &amp; Drop Files</b></span></div>
<div></div>
</div>
<div class="ajax-file-upload-container"></div>
</body>
<script>
$("#showoldupload").uploadFile(
{
url: "upload",
dragDrop: true,
fileName: "file",
returnType: "json",
showDelete: true,
showDownload: false,
statusBarWidth: 300,
dragdropWidth: 300,
maxFileSize: 200 * 1024,
dragDropStr: "<span><b>拖动上传</b></span>",
sizeErrorStr: "图片超过最大尺寸限制",
uploadErrorStr: "上传失败",
showPreview: true,
previewHeight: "60px",
previewWidth: "60px",
onSuccess: function (files, data) {
$.ajax({
url: "save-database",
dataType: "json",
data: {data: data, fileName: files},
});
},
onLoad: function (obj) {
$.ajax({
cache: false,
url: "previews",
dataType: "json",
success: function (data) {
for (var i = 0; i < data.length; i++) {
obj.createProgress(data[i]["name"], data[i]["path"], data[i]["size"]);
}
}
});
},
deleteCallback: function (data, pd) {
for (var i = 0; i < data.length; i++) {
// alertify.confirm('系统提示', "确定执行批量 '"+act+"' 操作?", function() {
$.post("image-del", {op: "delete", name: data[i]},
function (resp, textStatus, jqXHR) {
//Show Message
alert("File Deleted");
});
// },function(){
// });
}
pd.statusbar.hide(); //You choice.
},
});
</script>

24
kcadmin/views/category/update.php

@ -1,24 +0,0 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Category */
$this->title = 'Update Category: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Categories', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><?= Html::encode($this->title) ?></h3>
</div>
<?=
$this->render('_form', [
'model' => $model,
])
?>
</div>

43
kcadmin/views/category/view.php

@ -1,43 +0,0 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Category */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Categories', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
?>
<div class="category-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'cat_name',
'icon',
'icon_type',
'description:ntext',
'sort_order',
'created_at',
'updated_at',
],
]) ?>
</div>

33
kcadmin/views/layouts/base.php

@ -1,33 +0,0 @@
<?php
/* @var $this \yii\web\View */
/* @var $content string */
use kcadmin\assets\AppAsset;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use common\widgets\Alert;
AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $this->registerCsrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>
<?= $content ?>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>

25
kcadmin/views/layouts/breadcrumb.php

@ -1,25 +0,0 @@
<?PHP
use yii\widgets\Breadcrumbs;
?>
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<?php if (!empty($this->title)): ?>
<h1><?= $this->title ?><?php if (isset($this->params['subtitle'])): ?>
<small><?= $this->params['subtitle'] ?></small><?php endif ?></h1>
<?php endif ?>
</div>
<div class="col-sm-6">
<?php
echo Breadcrumbs::widget([
'tag' => 'ol',
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
'itemTemplate' => "<li class='breadcrumb-item'>{link}</li>\n",
'activeItemTemplate' => "<li class=\"breadcrumb-item active\">{link}</li>\n",
'options' => ['class' => 'breadcrumb float-sm-right']
]);
?>
</div>
</div>

7
kcadmin/views/layouts/footer.php

@ -1,7 +0,0 @@
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b>Version</b> 0.1.0
</div>
<strong>Copyright &copy; 2014-2019 <a href="https://kuaichuangkeji.com">KcAdmin</a>.</strong> All rights
reserved.
</footer>

67
kcadmin/views/layouts/header.php

@ -1,67 +0,0 @@
<?php
use yii\helpers\Html;
?>
<header>
<div class="wrapper">
<!-- Navbar -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="#" class="nav-link">Home</a>
</li>
</ul>
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
<!-- Messages Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="far fa-comments"></i>
<span class="badge badge-danger navbar-badge">3</span>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<div class="dropdown-divider"></div>
<div class="dropdown-divider"></div>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item dropdown-footer">See All Messages</a>
</div>
</li>
<!-- Notifications Dropdown Menu -->
<li class="nav-item user-menu ">
<a href="#" class="nav-link" data-toggle="dropdown">
<i class="fas fa-th-large"></i>
<!-- <img src="/img/user2-160x160.jpg" class="user-image" alt="User Image">-->
<!-- <span class="hidden-xs">-->
<? //= yii::$app->user->identity->username ?><!--</span>-->
</a>
<ul class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<!-- User image -->
<li class="user-header">
<img src="/img/user2-160x160.jpg" class="img-circle" alt="User Image">
<p>
<?= yii::$app->user->identity->username ?>
<small>Member since <?= date('m-d-Y', yii::$app->user->identity->created_at) ?></small>
</p>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<?= Html::a('个人设置', ['/site/profile'], ['class' => 'btn btn-default btn-flat']) ?>
</div>
<div class="pull-right">
<?= Html::a('退出', ['/site/logout'], ['data-method' => 'post', 'class' => 'btn btn-default btn-flat']) ?>
</div>
</li>
</ul>
<!-- <a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#"><i-->
<!-- class="fas fa-th-large"></i></a>-->
</li>
</ul>
</nav>
</header>

43
kcadmin/views/layouts/main.php

@ -1,43 +0,0 @@
<?php
/* @var $this \yii\web\View */
/* @var $content string */
use kcadmin\assets\AppAsset;
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<?php $this->registerCsrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
<body class="hold-transition skin-blue-light sidebar-mini">
<?php $this->beginBody() ?>
<div class="wrapper">
<?= $this->render('header') ?>
<?= $this->render('sidebar') ?>
<div class="content-wrapper">
<section class="content-header">
<?= $this->render('breadcrumb') ?>
</section>
<section class="content">
<?= $content ?>
</section>
</div>
<?= $this->render('footer') ?>
</div>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>

32
kcadmin/views/layouts/sidebar.php

@ -1,32 +0,0 @@
<?php
use iron\widgets\Menu;
?>
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<a href="index3.html" class="brand-link">
<img src="/img/logo.jpeg" alt="AdminLTE" class="brand-image img-circle elevation-3"
style="opacity: .8">
<span class="brand-text font-weight-light">AdminLTE 3</span>
</a>
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<?php
echo Menu::widget([
'items' => [
['label' => 'MAIN NAVIGATION', 'is_header' => true],
['label' => 'IndexController', 'url' => '#', 'icon' => 'fa-hand-o-right', 'items' => [
['label' => 'Index', 'url' => ['site/index', 'tag' => 'new']],
['label' => 'Test', 'url' => ['site/test']],
]
],
['label' => 'Category', 'url' => '#', 'icon' => 'fa-barcode', 'items' => [
['label' => 'List', 'url' => ['category/index', 'tag' => 'new']],
['label' => 'Create', 'url' => ['category/create', 'tag' => 'popular']],
]
]
]
]);
?>
</section>
<!-- /.sidebar -->
</aside>

27
kcadmin/views/site/error.php

@ -1,27 +0,0 @@
<?php
/* @var $this yii\web\View */
/* @var $name string */
/* @var $message string */
/* @var $exception Exception */
use yii\helpers\Html;
$this->title = $name;
?>
<div class="site-error">
<h1><?= Html::encode($this->title) ?></h1>
<div class="alert alert-danger">
<?= nl2br(Html::encode($message)) ?>
</div>
<p>
The above error occurred while the Web server was processing your request.
</p>
<p>
Please contact us if you think this is a server error. Thank you.
</p>
</div>

6
kcadmin/views/site/index.php

@ -1,6 +0,0 @@
<?php
/* @var $this yii\web\View */
$this->title = 'Dashboard';
$this->params['subtitle'] = 'Control panel';
$this->params['breadcrumbs'][] = $this->title;
?>

34
kcadmin/views/site/login.php

@ -1,34 +0,0 @@
<?php
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */
use yii\helpers\Html;
use yii\bootstrap4\ActiveForm;
$this->title = '系统登录';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="login-body">
<div class="login-form col-md-3 offset-md-4">
<h2><?= Html::encode($this->title) ?></h2>
<h6 class="login-tips font-small-3 line text-muted"><span>Login with Blobt Admin</span></h6>
<div class="row">
<div class="col-lg-12">
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
<?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?>
<?= $form->field($model, 'password')->passwordInput() ?>
<?= $form->field($model, 'rememberMe')->checkbox() ?>
<div class="form-group">
<?= Html::submitButton('Login', ['class' => 'btn btn-primary btn-lg btn-block', 'name' => 'login-button']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
</div>

68
kcadmin/views/site/test.php

@ -1,68 +0,0 @@
<?PHP
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use blobt\widgets\DateRangePicker;
$this->title = '测试';
$this->params['subtitle'] = '这是一个小小的测试';
$this->params['breadcrumbs'][] = $this->title;
/* @var $this yii\web\View */
/* @var $model common\models\CategorySearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
$form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
'validateOnType' => true,
]);
?>
<div class="col-sm-11">
<div class="dataTables_filter">
<?=
$form->field($model, 'id', [
"template" => "{input}{error}",
"inputOptions" => [
"placeholder" => "检索的id",
"class" => "form-control"
],
"errorOptions" => [
"class" => "error-tips"
]
])
?>
<?=
$form->field($model, 'cat_name', [
"template" => "{input}{error}",
"inputOptions" => [
"placeholder" => "检索类名",
"class" => "form-control",
],
"errorOptions" => [
"class" => "error-tips"
]
])
?>
<?=
$form->field($model, "created_at", [
"template" => "{input}{error}",
"errorOptions" => [
"class" => "error-tips"
]
])->widget(DateRangePicker::className());
?>
</div>
</div>
<div class="col-sm-1" style="padding: 0;">
<?= Html::submitButton('<i class="fa fa-filter"></i>', ['class' => 'btn btn-default']) ?>
<?= Html::resetButton('<i class="fa fa-eraser"></i>', ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>

2
kcadmin/web/assets/.gitignore

@ -1,2 +0,0 @@
*
!.gitignore

48
kcadmin/web/css/reset.css

@ -1,48 +0,0 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

52
kcadmin/web/css/site.css

@ -1,52 +0,0 @@
/*公共样式*/
/*登录页*/
.login-body{
display: flex;
align-items: center;
height: 100vh;
}
.login-body .line {
border-bottom: 1px solid #dadada;
line-height: 0.1em;
margin: 10px 0 20px;
}
.login-body .line span {
background: #fff;
padding: 0 10px;
}
.login-form {
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
margin: 0 auto;
}
.login-form h2{
text-align: center;
margin-bottom: 20px;
}
.login-form h6 {
text-align: center;
}
/*修复select2插件 from表框颜色不生效*/
.form-group.has-error .select2-selection, .form-group.has-error .select2-selection {
border-color: #dd4b39;
box-shadow: none;
}
.form-group.has-success .select2-selection, .form-group.has-success .select2-selection {
border-color: #00a65a;
box-shadow: none;
}
.icheck-label-group {
padding-top: 2px;
}
.icheck-label-group label{
margin-right: 20px;
}

BIN
kcadmin/web/favicon.ico

BIN
kcadmin/web/img/avatar.png

Before

Width: 215  |  Height: 215  |  Size: 7.9 KiB

BIN
kcadmin/web/img/avatar04.png

Before

Width: 215  |  Height: 215  |  Size: 13 KiB

BIN
kcadmin/web/img/avatar2.png

Before

Width: 215  |  Height: 215  |  Size: 8.1 KiB

BIN
kcadmin/web/img/avatar3.png

Before

Width: 215  |  Height: 215  |  Size: 9.0 KiB

BIN
kcadmin/web/img/avatar5.png

Before

Width: 215  |  Height: 215  |  Size: 7.4 KiB

BIN
kcadmin/web/img/credit/american-express.png

Before

Width: 51  |  Height: 32  |  Size: 2.1 KiB

BIN
kcadmin/web/img/credit/cirrus.png

Before

Width: 51  |  Height: 32  |  Size: 1.5 KiB

BIN
kcadmin/web/img/credit/mastercard.png

Before

Width: 51  |  Height: 32  |  Size: 1.6 KiB

BIN
kcadmin/web/img/credit/mestro.png

Before

Width: 52  |  Height: 32  |  Size: 1.5 KiB

BIN
kcadmin/web/img/credit/paypal.png

Before

Width: 101  |  Height: 64  |  Size: 2.0 KiB

BIN
kcadmin/web/img/credit/paypal2.png

Before

Width: 51  |  Height: 32  |  Size: 1.2 KiB

BIN
kcadmin/web/img/credit/visa.png

Before

Width: 51  |  Height: 32  |  Size: 1.0 KiB

BIN
kcadmin/web/img/default-50x50.gif

Before

Width: 50  |  Height: 50  |  Size: 184 B

BIN
kcadmin/web/img/icons.png

Before

Width: 61  |  Height: 37  |  Size: 1.1 KiB

BIN
kcadmin/web/img/logo.jpeg

Before

Width: 600  |  Height: 600  |  Size: 5.4 KiB

BIN
kcadmin/web/img/photo1.png

Before

Width: 1250  |  Height: 835  |  Size: 656 KiB

BIN
kcadmin/web/img/photo2.png

Before

Width: 1254  |  Height: 836  |  Size: 412 KiB

BIN
kcadmin/web/img/photo3.jpg

Before

Width: 2000  |  Height: 1333  |  Size: 383 KiB

BIN
kcadmin/web/img/photo4.jpg

Before

Width: 2000  |  Height: 1320  |  Size: 1.1 MiB

BIN
kcadmin/web/img/user1-128x128.jpg

Before

Width: 128  |  Height: 128  |  Size: 2.8 KiB

BIN
kcadmin/web/img/user2-160x160.jpg

Before

Width: 160  |  Height: 160  |  Size: 6.9 KiB

BIN
kcadmin/web/img/user3-128x128.jpg

Before

Width: 128  |  Height: 128  |  Size: 3.4 KiB

BIN
kcadmin/web/img/user4-128x128.jpg

Before

Width: 128  |  Height: 128  |  Size: 3.4 KiB

BIN
kcadmin/web/img/user5-128x128.jpg

Before

Width: 128  |  Height: 128  |  Size: 6.3 KiB

BIN
kcadmin/web/img/user6-128x128.jpg

Before

Width: 128  |  Height: 128  |  Size: 4.2 KiB

BIN
kcadmin/web/img/user7-128x128.jpg

Before

Width: 128  |  Height: 128  |  Size: 6.3 KiB

BIN
kcadmin/web/img/user8-128x128.jpg

Before

Width: 128  |  Height: 128  |  Size: 4.9 KiB

20
kcadmin/web/index.php

@ -1,20 +0,0 @@
<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/../../common/config/bootstrap.php';
require __DIR__ . '/../config/bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(
require __DIR__ . '/../../common/config/main.php',
require __DIR__ . '/../../common/config/main-local.php',
require __DIR__ . '/../config/main.php',
require __DIR__ . '/../config/main-local.php'
);
(new yii\web\Application($config))->run();

0
kcadmin/web/js/common.js

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save