-
2.gitignore
-
6backend/assets/AppAsset.php
-
18backend/controllers/AttributeController.php
-
76backend/controllers/ConfigController.php
-
131backend/controllers/OrderController.php
-
4backend/controllers/ShopCategoryController.php
-
0backend/controllers/SiteController.php
-
0backend/runtime/.gitignore
-
10backend/views/attribute/_search.php
-
6backend/views/attribute/index.php
-
8backend/views/category/_search.php
-
4backend/views/category/index.php
-
27backend/views/config/index.php
-
8backend/views/goods/_search.php
-
4backend/views/goods/index.php
-
2backend/views/layouts/base.php
-
30backend/views/layouts/breadcrumb.php
-
0backend/views/layouts/footer.php
-
95backend/views/layouts/header.php
-
4backend/views/layouts/main.php
-
34backend/views/layouts/sidebar.php
-
68backend/views/order/_form.php
-
36backend/views/order/_search.php
-
18backend/views/order/create.php
-
28backend/views/order/index.php
-
19backend/views/order/update.php
-
52backend/views/order/view.php
-
0backend/views/shop-category/_form.php
-
8backend/views/shop-category/_search.php
-
0backend/views/shop-category/create.php
-
6backend/views/shop-category/index.php
-
0backend/views/shop-category/update.php
-
0backend/views/shop-category/view.php
-
0backend/views/site/error.php
-
0backend/views/site/index.php
-
2backend/views/site/login.php
-
0backend/views/site/test.php
-
0backend/web/assets/.gitignore
-
6common/config/main.php
-
58common/models/ars/Config.php
-
4common/models/searchs/AttributeSearch.php
-
183common/models/searchs/OrderSearch.php
-
74composer.json
-
64composer.lock
-
26kcadmin/assets/AppAsset.php
-
4kcadmin/config/.gitignore
-
1kcadmin/config/bootstrap.php
-
46kcadmin/config/main.php
-
4kcadmin/config/params.php
-
112kcadmin/controllers/SiteController.php
-
1kcadmin/models/.gitkeep
-
43kcadmin/views/category/_form.php
-
21kcadmin/views/category/create.php
-
35kcadmin/views/category/index.php
-
98kcadmin/views/category/test.php
-
24kcadmin/views/category/update.php
-
43kcadmin/views/category/view.php
-
33kcadmin/views/layouts/base.php
-
25kcadmin/views/layouts/breadcrumb.php
-
7kcadmin/views/layouts/footer.php
-
67kcadmin/views/layouts/header.php
-
43kcadmin/views/layouts/main.php
-
32kcadmin/views/layouts/sidebar.php
-
27kcadmin/views/site/error.php
-
6kcadmin/views/site/index.php
-
34kcadmin/views/site/login.php
-
68kcadmin/views/site/test.php
-
2kcadmin/web/assets/.gitignore
-
48kcadmin/web/css/reset.css
-
52kcadmin/web/css/site.css
-
BINkcadmin/web/favicon.ico
-
BINkcadmin/web/img/avatar.png
-
BINkcadmin/web/img/avatar04.png
-
BINkcadmin/web/img/avatar2.png
-
BINkcadmin/web/img/avatar3.png
-
BINkcadmin/web/img/avatar5.png
-
BINkcadmin/web/img/credit/american-express.png
-
BINkcadmin/web/img/credit/cirrus.png
-
BINkcadmin/web/img/credit/mastercard.png
-
BINkcadmin/web/img/credit/mestro.png
-
BINkcadmin/web/img/credit/paypal.png
-
BINkcadmin/web/img/credit/paypal2.png
-
BINkcadmin/web/img/credit/visa.png
-
BINkcadmin/web/img/default-50x50.gif
-
BINkcadmin/web/img/icons.png
-
BINkcadmin/web/img/logo.jpeg
-
BINkcadmin/web/img/photo1.png
-
BINkcadmin/web/img/photo2.png
-
BINkcadmin/web/img/photo3.jpg
-
BINkcadmin/web/img/photo4.jpg
-
BINkcadmin/web/img/user1-128x128.jpg
-
BINkcadmin/web/img/user2-160x160.jpg
-
BINkcadmin/web/img/user3-128x128.jpg
-
BINkcadmin/web/img/user4-128x128.jpg
-
BINkcadmin/web/img/user5-128x128.jpg
-
BINkcadmin/web/img/user6-128x128.jpg
-
BINkcadmin/web/img/user7-128x128.jpg
-
BINkcadmin/web/img/user8-128x128.jpg
-
20kcadmin/web/index.php
-
0kcadmin/web/js/common.js
@ -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.'); |
||||
|
} |
||||
|
} |
@ -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. |
||||
|
*/ |
||||
|
?>
|
||||
|
|
||||
|
配置页 |
@ -1,13 +1,25 @@ |
|||||
<?PHP |
<?PHP |
||||
|
|
||||
use yii\widgets\Breadcrumbs; |
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([ |
|
||||
'tag' => 'ol', |
|
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['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> |
@ -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> |
@ -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> |
@ -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> |
@ -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> |
@ -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> |
@ -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' |
||||
|
]; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
@ -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; |
||||
|
} |
||||
|
} |
@ -1,39 +1,39 @@ |
|||||
{ |
{ |
||||
"name": "blobt/kcbasic", |
|
||||
"description": "This is a fast template using for small project in KcDev.", |
|
||||
"type": "project", |
|
||||
"license": "MIT", |
|
||||
"authors": [ |
|
||||
{ |
|
||||
"name": "blobt", |
|
||||
"email": "380255922@qq.com" |
|
||||
} |
|
||||
], |
|
||||
"minimum-stability": "dev", |
|
||||
"require": { |
|
||||
"php": ">=7.1.0", |
|
||||
"yiisoft/yii2": "~2.0.14", |
|
||||
"yiisoft/yii2-bootstrap4": "~2.0.6", |
|
||||
"moonlandsoft/yii2-phpexcel": "*" |
|
||||
}, |
|
||||
"repositories": { |
|
||||
"asset_packagist": { |
|
||||
"type": "composer", |
|
||||
"url": "https://asset-packagist.org" |
|
||||
}, |
|
||||
"kc_packagist": { |
|
||||
"type": "composer", |
|
||||
"url": "https://packagist.kcshop.com.cn/" |
|
||||
}, |
|
||||
|
|
||||
"packagist": { |
|
||||
"type": "composer", |
|
||||
"url": "https://packagist.phpcomposer.com" |
|
||||
} |
|
||||
}, |
|
||||
"require-dev": { |
|
||||
"yiisoft/yii2-debug": "^2.0@dev", |
|
||||
"kint-php/kint": "dev-master", |
|
||||
"yiisoft/yii2-gii": "^2.0@dev" |
|
||||
} |
|
||||
|
"name": "blobt/kcbasic", |
||||
|
"description": "This is a fast template using for small project in KcDev.", |
||||
|
"type": "project", |
||||
|
"license": "MIT", |
||||
|
"authors": [ |
||||
|
{ |
||||
|
"name": "blobt", |
||||
|
"email": "380255922@qq.com" |
||||
|
} |
||||
|
], |
||||
|
"minimum-stability": "dev", |
||||
|
"require": { |
||||
|
"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": { |
||||
|
"asset_packagist": { |
||||
|
"type": "composer", |
||||
|
"url": "https://asset-packagist.org" |
||||
|
}, |
||||
|
"kc_packagist": { |
||||
|
"type": "composer", |
||||
|
"url": "https://packagist.kcshop.com.cn/" |
||||
|
}, |
||||
|
"packagist": { |
||||
|
"type": "composer", |
||||
|
"url": "https://packagist.phpcomposer.com" |
||||
|
} |
||||
|
}, |
||||
|
"require-dev": { |
||||
|
"yiisoft/yii2-debug": "^2.0@dev", |
||||
|
"kint-php/kint": "dev-master", |
||||
|
"yiisoft/yii2-gii": "^2.0@dev" |
||||
|
} |
||||
} |
} |
@ -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', |
|
||||
]; |
|
||||
} |
|
@ -1,4 +0,0 @@ |
|||||
codeception-local.php |
|
||||
main-local.php |
|
||||
params-local.php |
|
||||
test-local.php |
|
@ -1 +0,0 @@ |
|||||
<?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, |
|
||||
]; |
|
@ -1,4 +0,0 @@ |
|||||
<?php |
|
||||
return [ |
|
||||
'adminEmail' => 'admin@example.com', |
|
||||
]; |
|
@ -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 +0,0 @@ |
|||||
* |
|
@ -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(); ?>
|
|
||||
|
|
||||
|
|
@ -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> |
|
@ -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> |
|
@ -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 & 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> |
|
@ -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> |
|
@ -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> |
|
@ -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() ?>
|
|
@ -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> |
|
@ -1,7 +0,0 @@ |
|||||
<footer class="main-footer"> |
|
||||
<div class="pull-right hidden-xs"> |
|
||||
<b>Version</b> 0.1.0 |
|
||||
</div> |
|
||||
<strong>Copyright © 2014-2019 <a href="https://kuaichuangkeji.com">KcAdmin</a>.</strong> All rights |
|
||||
reserved. |
|
||||
</footer> |
|
@ -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> |
|
@ -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() ?>
|
|
@ -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> |
|
@ -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> |
|
@ -1,6 +0,0 @@ |
|||||
<?php |
|
||||
/* @var $this yii\web\View */ |
|
||||
$this->title = 'Dashboard'; |
|
||||
$this->params['subtitle'] = 'Control panel'; |
|
||||
$this->params['breadcrumbs'][] = $this->title; |
|
||||
?>
|
|
@ -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> |
|
@ -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(); ?>
|
|
||||
|
|
@ -1,2 +0,0 @@ |
|||||
* |
|
||||
!.gitignore |
|
@ -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; |
|
||||
} |
|
@ -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; |
|
||||
} |
|
Before Width: 215 | Height: 215 | Size: 7.9 KiB |
Before Width: 215 | Height: 215 | Size: 13 KiB |
Before Width: 215 | Height: 215 | Size: 8.1 KiB |
Before Width: 215 | Height: 215 | Size: 9.0 KiB |
Before Width: 215 | Height: 215 | Size: 7.4 KiB |
Before Width: 51 | Height: 32 | Size: 2.1 KiB |
Before Width: 51 | Height: 32 | Size: 1.5 KiB |
Before Width: 51 | Height: 32 | Size: 1.6 KiB |
Before Width: 52 | Height: 32 | Size: 1.5 KiB |
Before Width: 101 | Height: 64 | Size: 2.0 KiB |
Before Width: 51 | Height: 32 | Size: 1.2 KiB |
Before Width: 51 | Height: 32 | Size: 1.0 KiB |
Before Width: 50 | Height: 50 | Size: 184 B |
Before Width: 61 | Height: 37 | Size: 1.1 KiB |
Before Width: 600 | Height: 600 | Size: 5.4 KiB |
Before Width: 1250 | Height: 835 | Size: 656 KiB |
Before Width: 1254 | Height: 836 | Size: 412 KiB |
Before Width: 2000 | Height: 1333 | Size: 383 KiB |
Before Width: 2000 | Height: 1320 | Size: 1.1 MiB |
Before Width: 128 | Height: 128 | Size: 2.8 KiB |
Before Width: 160 | Height: 160 | Size: 6.9 KiB |
Before Width: 128 | Height: 128 | Size: 3.4 KiB |
Before Width: 128 | Height: 128 | Size: 3.4 KiB |
Before Width: 128 | Height: 128 | Size: 6.3 KiB |
Before Width: 128 | Height: 128 | Size: 4.2 KiB |
Before Width: 128 | Height: 128 | Size: 6.3 KiB |
Before Width: 128 | Height: 128 | Size: 4.9 KiB |
@ -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(); |
|
||||
|
|
||||
|
|