root
5 years ago
197 changed files with 3726 additions and 3474 deletions
-
4.gitignore
-
26api/assets/AppAsset.php
-
61api/config/params.php
-
22api/controllers/SiteController.php
-
59api/controllers/TestController.php
-
5api/controllers/UserController.php
-
2api/runtime/.gitignore
-
27api/views/site/error.php
-
5api/web/.gitignore
-
120api/web/css/site.css
-
BINapi/web/favicon.ico
-
18backend/config/main.php
-
149backend/controllers/CategoryController.php
-
0backend/controllers/ConfigController.php
-
151backend/controllers/GoodsController.php
-
0backend/controllers/OrderController.php
-
149backend/controllers/ShopCategoryController.php
-
0backend/controllers/SiteController.php
-
122backend/logic/file/FileManager.php
-
47backend/views/brand/_search.php
-
38backend/views/category/_form.php
-
98backend/views/category/test.php
-
0backend/views/config/index.php
-
82backend/views/goods/_form.php
-
0backend/views/layouts/base.php
-
0backend/views/layouts/breadcrumb.php
-
0backend/views/layouts/footer.php
-
0backend/views/layouts/header.php
-
0backend/views/layouts/main.php
-
19backend/views/layouts/sidebar.php
-
0backend/views/order/_form.php
-
0backend/views/order/_search.php
-
0backend/views/order/create.php
-
0backend/views/order/index.php
-
0backend/views/order/update.php
-
0backend/views/order/view.php
-
44backend/views/shop-category/_form.php
-
0backend/views/site/error.php
-
0backend/views/site/index.php
-
0backend/views/site/login.php
-
0backend/views/site/test.php
-
47backend/views/supplier/_search.php
-
BINbackend/web/uploads/xls/15738696921690.jpg
-
17common/config/params.php
-
2common/models/ars/Address.php
-
2common/models/ars/AfterSale.php
-
1common/models/ars/Area.php
-
2common/models/ars/Cart.php
-
1common/models/ars/City.php
-
2common/models/ars/Collection.php
-
2common/models/ars/Comment.php
-
0common/models/ars/Config.php
-
2common/models/ars/Delivery.php
-
2common/models/ars/ExpressTemplate.php
-
8common/models/ars/File.php
-
2common/models/ars/Order.php
-
2common/models/ars/OrderGoods.php
-
1common/models/ars/PaymentLog.php
-
1common/models/ars/Province.php
-
1common/models/ars/RefundLog.php
-
2common/models/ars/SearchHistory.php
-
2common/models/ars/TakingSite.php
-
2common/models/ars/TemFile.php
-
0common/models/searchs/OrderSearch.php
-
5composer.json
-
2console/controllers/InitController.php
-
0console/migrations/m130524_201442_init.php
-
0console/migrations/m140506_102106_rbac_init.php
-
0console/migrations/m170907_052038_rbac_add_index_on_auth_assignment_user_id.php
-
0console/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php
-
0console/migrations/m190124_110200_add_verification_token_column_to_user_table.php
-
0console/migrations/m190802_072830_add_category.php
-
0console/migrations/m191111_101658_create_table_area.php
-
0console/migrations/m191111_102644_create_table_province.php
-
0console/migrations/m191111_102730_create_table_city.php
-
8console/migrations/m191111_102925_create_table_cart.php
-
8console/migrations/m191111_112559_create_table_address.php
-
6console/migrations/m191111_113455_create_table_after_sale.php
-
2console/migrations/m191112_005106_create_table_search_history.php
-
4console/migrations/m191112_005545_create_table_collection.php
-
2console/migrations/m191112_005702_create_table_comment.php
-
2console/migrations/m191112_010421_create_table_order.php
-
4console/migrations/m191112_011517_create_table_order_goods.php
-
2console/migrations/m191112_012449_create_table_taking_site.php
-
2console/migrations/m191112_014508_create_table_express_template.php
-
2console/migrations/m191112_015939_create_table_delivery.php
-
0console/migrations/m191112_020830_create_table_payment_log.php
-
0console/migrations/m191112_021528_create_table_refund_log.php
-
0console/migrations/m191112_022131_create_table_file.php
-
0console/migrations/m191112_022532_create_table_tem_file.php
-
0console/migrations/schema-mysql.sql
-
0console/migrations/sql/add_category.sql
-
0console/migrations/sql/area.sql
-
0console/migrations/sql/city.sql
-
0console/migrations/sql/province.sql
-
0datadictionary.md
-
8environments/skeleton/backend/config/main-local.php
-
0environments/skeleton/backend/config/params-local.php
-
14vendor/antgoods/goods/AutoloadExample.php
-
31vendor/antgoods/goods/README.md
@ -0,0 +1,26 @@ |
|||
<?php |
|||
|
|||
namespace backend\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,15 +1,66 @@ |
|||
<?php |
|||
return [ |
|||
'permissions'=>[ |
|||
'permissions' => [ |
|||
"网站基本权限" => [ |
|||
'首页(销售数据)' => '/site/index', |
|||
'用户注销' => '/site/logout', |
|||
'用户登录' => '/site/login', |
|||
], |
|||
"商品模块" => [ |
|||
'商品列表' => '/goods/index', |
|||
'商品新增' => '/goods/create', |
|||
'商品修改' => '/goods/update', |
|||
"商品管理" => [ |
|||
'商品列表' => '/antgoods/goods/index', |
|||
'商品新增' => '/antgoods/goods/create', |
|||
'商品修改' => '/antgoods/goods/update', |
|||
'商品查看' => '/antgoods/goods/view', |
|||
], |
|||
"商城分类" => [ |
|||
'列表' => '/antgoods/shop-category/index', |
|||
'新增' => '/antgoods/shop-category/create', |
|||
'修改' => '/antgoods/shop-category/update', |
|||
'查看' => '/antgoods/shop-category/view', |
|||
], |
|||
"后台分类" => [ |
|||
'列表' => '/antgoods/category/index', |
|||
'新增' => '/antgoods/category/create', |
|||
'修改' => '/antgoods/category/update', |
|||
'查看' => '/antgoods/category/view', |
|||
], |
|||
"品牌管理" => [ |
|||
'列表' => '/antgoods/brand/index', |
|||
'新增' => '/antgoods/brand/create', |
|||
'修改' => '/antgoods/brand/update', |
|||
'查看' => '/antgoods/brand/view', |
|||
], |
|||
"供应商管理" => [ |
|||
'列表' => '/antgoods/supplier/index', |
|||
'新增' => '/antgoods/supplier/create', |
|||
'修改' => '/antgoods/supplier/update', |
|||
'查看' => '/antgoods/supplier/view', |
|||
], |
|||
"属性管理" => [ |
|||
'列表' => '/antgoods/attribute/index', |
|||
'新增' => '/antgoods/attribute/create', |
|||
'修改' => '/antgoods/attribute/update', |
|||
'查看' => '/antgoods/attribute/view', |
|||
] |
|||
], |
|||
'menus' => [ |
|||
'商城管理' => [ |
|||
'icon' => 'fa-store', |
|||
'items' => [ |
|||
['运营数据', '/site',], |
|||
['基础配置', '/config'], |
|||
], |
|||
], |
|||
'商品管理' => [ |
|||
'icon' => 'fa-archive', |
|||
'items' => [ |
|||
['商城分类', '/antgoods/shop-category'], |
|||
['后台分类', '/antgoods/category'], |
|||
['品牌管理', '/antgoods/brand'], |
|||
['属性管理', '/antgoods/attribute'], |
|||
['商品管理', '/antgoods/goods'], |
|||
['供应商管理', '/antgoods/supplier'], |
|||
], |
|||
] |
|||
] |
|||
]; |
@ -0,0 +1,22 @@ |
|||
<?php |
|||
|
|||
namespace api\controllers; |
|||
|
|||
use yii\web\Controller; |
|||
|
|||
/** |
|||
* Created by PhpStorm. |
|||
* User: iron |
|||
* Date: 2018/5/25 |
|||
* Time: 16:42 |
|||
*/ |
|||
class SiteController extends Controller |
|||
{ |
|||
public function actions() { |
|||
return [ |
|||
'error' => [ |
|||
'class' => 'yii\web\ErrorAction', |
|||
], |
|||
]; |
|||
} |
|||
} |
@ -0,0 +1,59 @@ |
|||
<?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 api\controllers; |
|||
/** |
|||
* @author iron |
|||
* @email weiriron@gmail.com |
|||
*/ |
|||
|
|||
use common\models\ars\Goods; |
|||
use common\models\searchs\GoodsSearch; |
|||
use yii\data\ActiveDataProvider; |
|||
use yii\db\ActiveRecord; |
|||
use yii\rest\ActiveController; |
|||
use yii\web\NotFoundHttpException; |
|||
|
|||
class TestController extends ActiveController |
|||
{ |
|||
public $modelClass = 'common\models\ars\Goods'; |
|||
|
|||
public function actions() |
|||
{ |
|||
$action = parent::actions(); |
|||
unset($action['index']); |
|||
return$action; |
|||
} |
|||
|
|||
public function actionIndex() |
|||
{ |
|||
return new ActiveDataProvider([ |
|||
'query' => Goods::find(), |
|||
'pagination' => [ |
|||
'pageSize' => 1, |
|||
], |
|||
]); |
|||
} |
|||
} |
@ -0,0 +1,2 @@ |
|||
* |
|||
!.gitignore |
@ -0,0 +1,27 @@ |
|||
<?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> |
@ -0,0 +1,5 @@ |
|||
/index.php |
|||
/index-test.php |
|||
/robots.txt |
|||
uploads |
|||
|
@ -0,0 +1,120 @@ |
|||
html, |
|||
body { |
|||
height: 100%; |
|||
} |
|||
|
|||
.wrap { |
|||
min-height: 100%; |
|||
height: auto; |
|||
margin: 0 auto -60px; |
|||
padding: 0 0 60px; |
|||
} |
|||
|
|||
.wrap > .container { |
|||
padding: 70px 15px 20px; |
|||
} |
|||
|
|||
.footer { |
|||
height: 60px; |
|||
background-color: #f5f5f5; |
|||
border-top: 1px solid #ddd; |
|||
padding-top: 20px; |
|||
} |
|||
|
|||
.jumbotron { |
|||
text-align: center; |
|||
background-color: transparent; |
|||
} |
|||
|
|||
.jumbotron .btn { |
|||
font-size: 21px; |
|||
padding: 14px 24px; |
|||
} |
|||
|
|||
.not-set { |
|||
color: #c55; |
|||
font-style: italic; |
|||
} |
|||
|
|||
/* add sorting icons to gridview sort links */ |
|||
a.asc:after, a.desc:after { |
|||
position: relative; |
|||
top: 1px; |
|||
display: inline-block; |
|||
font-family: 'Glyphicons Halflings'; |
|||
font-style: normal; |
|||
font-weight: normal; |
|||
line-height: 1; |
|||
padding-left: 5px; |
|||
} |
|||
|
|||
a.asc:after { |
|||
content: /*"\e113"*/ "\e151"; |
|||
} |
|||
|
|||
a.desc:after { |
|||
content: /*"\e114"*/ "\e152"; |
|||
} |
|||
|
|||
.sort-numerical a.asc:after { |
|||
content: "\e153"; |
|||
} |
|||
|
|||
.sort-numerical a.desc:after { |
|||
content: "\e154"; |
|||
} |
|||
|
|||
.sort-ordinal a.asc:after { |
|||
content: "\e155"; |
|||
} |
|||
|
|||
.sort-ordinal a.desc:after { |
|||
content: "\e156"; |
|||
} |
|||
|
|||
.grid-view td { |
|||
white-space: nowrap; |
|||
} |
|||
|
|||
.grid-view .filters input, |
|||
.grid-view .filters select { |
|||
min-width: 50px; |
|||
} |
|||
|
|||
.hint-block { |
|||
display: block; |
|||
margin-top: 5px; |
|||
color: #999; |
|||
} |
|||
|
|||
.error-summary { |
|||
color: #a94442; |
|||
background: #fdf7f7; |
|||
border-left: 3px solid #eed3d7; |
|||
padding: 10px 20px; |
|||
margin: 0 0 15px 0; |
|||
} |
|||
|
|||
/* align the logout "link" (button in forms) of the navbar */ |
|||
.nav li > form > button.logout { |
|||
padding: 15px; |
|||
border: none; |
|||
} |
|||
|
|||
@media(max-width:767px) { |
|||
.nav li > form > button.logout { |
|||
display:block; |
|||
text-align: left; |
|||
width: 100%; |
|||
padding: 10px 15px; |
|||
} |
|||
} |
|||
|
|||
.nav > li > form > button.logout:focus, |
|||
.nav > li > form > button.logout:hover { |
|||
text-decoration: none; |
|||
} |
|||
|
|||
.nav > li > form > button.logout:focus { |
|||
outline: none; |
|||
} |
@ -1,149 +0,0 @@ |
|||
<?php |
|||
|
|||
namespace backend\controllers; |
|||
|
|||
use Yii; |
|||
use common\models\ars\Category; |
|||
use common\models\searchs\CategorySearch; |
|||
use yii\web\Controller; |
|||
use yii\web\NotFoundHttpException; |
|||
use yii\filters\VerbFilter; |
|||
|
|||
/** |
|||
* CategoryController implements the CRUD actions for Category model. |
|||
*/ |
|||
class CategoryController extends Controller |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function behaviors() |
|||
{ |
|||
return [ |
|||
'verbs' => [ |
|||
'class' => VerbFilter::className(), |
|||
'actions' => [ |
|||
'delete' => ['POST'], |
|||
], |
|||
], |
|||
]; |
|||
} |
|||
|
|||
/** |
|||
* Lists all Category models. |
|||
* @return mixed |
|||
*/ |
|||
public function actionIndex() |
|||
{ |
|||
$searchModel = new CategorySearch(); |
|||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); |
|||
|
|||
return $this->render('index', [ |
|||
'searchModel' => $searchModel, |
|||
'dataProvider' => $dataProvider, |
|||
'columns' => $searchModel->columns() |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Displays a single Category model. |
|||
* @param integer $id |
|||
* @return mixed |
|||
* @throws NotFoundHttpException if the model cannot be found |
|||
*/ |
|||
public function actionView($id) |
|||
{ |
|||
return $this->render('view', [ |
|||
'model' => $this->findModel($id), |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Creates a new Category model. |
|||
* If creation is successful, the browser will be redirected to the 'view' page. |
|||
* @return mixed |
|||
*/ |
|||
public function actionCreate() |
|||
{ |
|||
$model = new Category(); |
|||
|
|||
if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|||
return $this->redirect('index'); |
|||
} |
|||
|
|||
return $this->render('create', [ |
|||
'model' => $model, |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* 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, |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Deletes an existing Category model. |
|||
* If deletion is successful, the browser will be redirected to the 'index' page. |
|||
* @param integer $id |
|||
* @return mixed |
|||
* @throws NotFoundHttpException if the model cannot be found |
|||
*/ |
|||
public function actionDelete($id) |
|||
{ |
|||
$this->findModel($id)->delete(); |
|||
|
|||
return $this->redirect(['index']); |
|||
} |
|||
|
|||
/** |
|||
* 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.'); |
|||
} |
|||
/** |
|||
* @author iron |
|||
* 文件导出 |
|||
*/ |
|||
public function actionExport() |
|||
{ |
|||
$searchModel = new CategorySearch(); |
|||
$params = Yii::$app->request->queryParams; |
|||
if ($params['page-type'] == 'all') { |
|||
$dataProvider = $searchModel->allData($params); |
|||
} else { |
|||
$dataProvider = $searchModel->search($params); |
|||
} |
|||
\iron\widget\Excel::export([ |
|||
'models' => $dataProvider->getModels(), |
|||
'format' => 'Xlsx', |
|||
'asAttachment' => true, |
|||
'fileName' =>'Categories'. "-" .date('Y-m-d H/i/s', time()), |
|||
'columns' => $searchModel->columns() |
|||
]); |
|||
} |
|||
} |
@ -1,151 +0,0 @@ |
|||
<?php |
|||
|
|||
namespace backend\controllers; |
|||
|
|||
use common\models\Category; |
|||
use common\models\User; |
|||
use Yii; |
|||
use common\models\ars\Goods; |
|||
use common\models\searchs\GoodsSearch; |
|||
use yii\web\Controller; |
|||
use yii\web\NotFoundHttpException; |
|||
use yii\filters\VerbFilter; |
|||
|
|||
/** |
|||
* GoodsController implements the CRUD actions for Goods model. |
|||
*/ |
|||
class GoodsController extends Controller |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function behaviors() |
|||
{ |
|||
return [ |
|||
'verbs' => [ |
|||
'class' => VerbFilter::className(), |
|||
'actions' => [ |
|||
'delete' => ['POST'], |
|||
], |
|||
], |
|||
]; |
|||
} |
|||
|
|||
/** |
|||
* Lists all Goods models. |
|||
* @return mixed |
|||
*/ |
|||
public function actionIndex() |
|||
{ |
|||
$searchModel = new GoodsSearch(); |
|||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); |
|||
|
|||
return $this->render('index', [ |
|||
'searchModel' => $searchModel, |
|||
'dataProvider' => $dataProvider, |
|||
'columns' => $searchModel->columns() |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Displays a single Goods model. |
|||
* @param integer $id |
|||
* @return mixed |
|||
* @throws NotFoundHttpException if the model cannot be found |
|||
*/ |
|||
public function actionView($id) |
|||
{ |
|||
return $this->render('view', [ |
|||
'model' => $this->findModel($id), |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Creates a new Goods model. |
|||
* If creation is successful, the browser will be redirected to the 'view' page. |
|||
* @return mixed |
|||
*/ |
|||
public function actionCreate() |
|||
{ |
|||
$model = new Goods(); |
|||
|
|||
if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|||
return $this->redirect('index'); |
|||
} |
|||
|
|||
return $this->render('create', [ |
|||
'model' => $model, |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Updates an existing Goods 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, |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Deletes an existing Goods model. |
|||
* If deletion is successful, the browser will be redirected to the 'index' page. |
|||
* @param integer $id |
|||
* @return mixed |
|||
* @throws NotFoundHttpException if the model cannot be found |
|||
*/ |
|||
public function actionDelete($id) |
|||
{ |
|||
$this->findModel($id)->delete(); |
|||
|
|||
return $this->redirect(['index']); |
|||
} |
|||
|
|||
/** |
|||
* Finds the Goods model based on its primary key value. |
|||
* If the model is not found, a 404 HTTP exception will be thrown. |
|||
* @param integer $id |
|||
* @return Goods the loaded model |
|||
* @throws NotFoundHttpException if the model cannot be found |
|||
*/ |
|||
protected function findModel($id) |
|||
{ |
|||
if (($model = Goods::findOne($id)) !== null) { |
|||
return $model; |
|||
} |
|||
|
|||
throw new NotFoundHttpException('The requested page does not exist.'); |
|||
} |
|||
/** |
|||
* @author iron |
|||
* 文件导出 |
|||
*/ |
|||
public function actionExport() |
|||
{ |
|||
$searchModel = new GoodsSearch(); |
|||
$params = Yii::$app->request->queryParams; |
|||
if ($params['page-type'] == 'all') { |
|||
$dataProvider = $searchModel->allData($params); |
|||
} else { |
|||
$dataProvider = $searchModel->search($params); |
|||
} |
|||
\iron\widget\Excel::export([ |
|||
'models' => $dataProvider->getModels(), |
|||
'format' => 'Xlsx', |
|||
'asAttachment' => true, |
|||
'fileName' =>'Goods'. "-" .date('Y-m-d H/i/s', time()), |
|||
'columns' => $searchModel->columns() |
|||
]); |
|||
} |
|||
} |
@ -1,149 +0,0 @@ |
|||
<?php |
|||
|
|||
namespace backend\controllers; |
|||
|
|||
use Yii; |
|||
use common\models\ars\ShopCategory; |
|||
use common\models\searchs\ShopCategorySearch; |
|||
use yii\web\Controller; |
|||
use yii\web\NotFoundHttpException; |
|||
use yii\filters\VerbFilter; |
|||
|
|||
/** |
|||
* ShopCategoryController implements the CRUD actions for ShopCategory model. |
|||
*/ |
|||
class ShopCategoryController extends Controller |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function behaviors() |
|||
{ |
|||
return [ |
|||
'verbs' => [ |
|||
'class' => VerbFilter::className(), |
|||
'actions' => [ |
|||
'delete' => ['POST'], |
|||
], |
|||
], |
|||
]; |
|||
} |
|||
|
|||
/** |
|||
* Lists all ShopCategory models. |
|||
* @return mixed |
|||
*/ |
|||
public function actionIndex() |
|||
{ |
|||
$searchModel = new ShopCategorySearch(); |
|||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); |
|||
|
|||
return $this->render('index', [ |
|||
'searchModel' => $searchModel, |
|||
'dataProvider' => $dataProvider, |
|||
'columns' => $searchModel->columns() |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Displays a single ShopCategory model. |
|||
* @param integer $id |
|||
* @return mixed |
|||
* @throws NotFoundHttpException if the model cannot be found |
|||
*/ |
|||
public function actionView($id) |
|||
{ |
|||
return $this->render('view', [ |
|||
'model' => $this->findModel($id), |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Creates a new ShopCategory model. |
|||
* If creation is successful, the browser will be redirected to the 'view' page. |
|||
* @return mixed |
|||
*/ |
|||
public function actionCreate() |
|||
{ |
|||
$model = new ShopCategory(); |
|||
|
|||
if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|||
return $this->redirect('index'); |
|||
} |
|||
|
|||
return $this->render('create', [ |
|||
'model' => $model, |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Updates an existing ShopCategory 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, |
|||
]); |
|||
} |
|||
|
|||
/** |
|||
* Deletes an existing ShopCategory model. |
|||
* If deletion is successful, the browser will be redirected to the 'index' page. |
|||
* @param integer $id |
|||
* @return mixed |
|||
* @throws NotFoundHttpException if the model cannot be found |
|||
*/ |
|||
public function actionDelete($id) |
|||
{ |
|||
$this->findModel($id)->delete(); |
|||
|
|||
return $this->redirect(['index']); |
|||
} |
|||
|
|||
/** |
|||
* Finds the ShopCategory model based on its primary key value. |
|||
* If the model is not found, a 404 HTTP exception will be thrown. |
|||
* @param integer $id |
|||
* @return ShopCategory the loaded model |
|||
* @throws NotFoundHttpException if the model cannot be found |
|||
*/ |
|||
protected function findModel($id) |
|||
{ |
|||
if (($model = ShopCategory::findOne($id)) !== null) { |
|||
return $model; |
|||
} |
|||
|
|||
throw new NotFoundHttpException('The requested page does not exist.'); |
|||
} |
|||
/** |
|||
* @author iron |
|||
* 文件导出 |
|||
*/ |
|||
public function actionExport() |
|||
{ |
|||
$searchModel = new ShopCategorySearch(); |
|||
$params = Yii::$app->request->queryParams; |
|||
if ($params['page-type'] == 'all') { |
|||
$dataProvider = $searchModel->allData($params); |
|||
} else { |
|||
$dataProvider = $searchModel->search($params); |
|||
} |
|||
\iron\widget\Excel::export([ |
|||
'models' => $dataProvider->getModels(), |
|||
'format' => 'Xlsx', |
|||
'asAttachment' => true, |
|||
'fileName' =>'Shop Categories'. "-" .date('Y-m-d H/i/s', time()), |
|||
'columns' => $searchModel->columns() |
|||
]); |
|||
} |
|||
} |
@ -0,0 +1,122 @@ |
|||
<?php |
|||
|
|||
|
|||
namespace backend\logic\file; |
|||
|
|||
use common\models\ars\File; |
|||
use common\models\ars\TemFile; |
|||
|
|||
class FileManager |
|||
{ |
|||
//数据表ats_file和ats_tem_file的类型字段type
|
|||
const TYPE_IMAGE = 1;//图片
|
|||
const TYPE_VIDEO = 2;//影视
|
|||
const TYPE_EXCEL = 3;//excel表单
|
|||
const TYPE_WORD = 4;//word文本
|
|||
const TYPE_TXT = 5;//txt文本
|
|||
|
|||
public static $extension = [ |
|||
self::TYPE_IMAGE => ['jpg', 'png', 'jpeg'], |
|||
self::TYPE_VIDEO => ['mp4'], |
|||
self::TYPE_EXCEL => [], |
|||
self::TYPE_WORD => ['docx'], |
|||
self::TYPE_TXT => ['txt'], |
|||
]; |
|||
|
|||
/** |
|||
* @param $array |
|||
* @param $keyword |
|||
* @return bool|int|string |
|||
* 根据文件拓展名在$extension中查找对应的文件类型,若不存在则返回false |
|||
*/ |
|||
public function searchType($array, $keyword) |
|||
{ |
|||
foreach($array as $key => $value){ |
|||
foreach ($value as $k => $v) { |
|||
if($v == $keyword){ |
|||
return ['status' => true, 'info' => '操作成功', 'type' => $key]; |
|||
} |
|||
} |
|||
} |
|||
return ['status' => false, 'info' => '操作失败']; |
|||
} |
|||
|
|||
/** |
|||
* @param $imgIdStr |
|||
* @param $ownId |
|||
* @param $ownType |
|||
* @return array |
|||
* 根据临时文件id(字符串)将临时文件保存在文件中 |
|||
*/ |
|||
public function saveTemFileToFile($temFIleIdArr, $ownId, $ownType) |
|||
{ |
|||
if(!$temFIleIdArr || !$ownId) { |
|||
return ['status' => false, 'info' => '参数错误']; |
|||
} |
|||
|
|||
$i = 1; |
|||
$first_file_id = 0; |
|||
foreach ($temFIleIdArr as $key => $value) { |
|||
$tem_file = TemFile::findOne($value); |
|||
|
|||
if(!$tem_file) { |
|||
return ['status' => false, 'info' => '存在查找不到的文件']; |
|||
} |
|||
|
|||
$res = self::saveNewFile($tem_file, $ownId, $ownType); |
|||
if(!$res['status']) { |
|||
return ['status' => false, 'info' => '存在文件保存失败']; |
|||
} |
|||
if($i == 1) { |
|||
$first_file_id = $res['file_id']; |
|||
} |
|||
|
|||
$i++; |
|||
} |
|||
|
|||
return ['status' => true, 'info' => '保存成功', 'first_file_id' => $first_file_id]; |
|||
} |
|||
|
|||
/** |
|||
* @param $temFile |
|||
* @param $ownId |
|||
* @param $ownType |
|||
* @return bool |
|||
* 创建新的文件 |
|||
*/ |
|||
private function saveNewFile($temFile, $ownId, $ownType) |
|||
{ |
|||
$new_file = new File(); |
|||
$new_file->name = $temFile->name; |
|||
$new_file->type = $temFile->type; |
|||
$new_file->own_id = $ownId; |
|||
$new_file->own_type = $ownType; |
|||
$new_file->alias = $temFile->alias; |
|||
$new_file->path = $temFile->path; |
|||
if($new_file->save()) { |
|||
return ['status' => true, 'info' => '操作成功', 'file_id' => $new_file->id]; |
|||
} else { |
|||
return ['status' => false, 'info' => '操作失败']; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @param $fileIdArr |
|||
* 删除file表中的文件 |
|||
*/ |
|||
public function deleteFile($fileIdArr) |
|||
{ |
|||
if($fileIdArr){ |
|||
foreach ($fileIdArr as $key => $value) { |
|||
$file_model = File::findOne($value); |
|||
if($file_model){ |
|||
$file_model->is_delete = File::IS_DELETE_YES; |
|||
if($file_model->save()){ |
|||
return ['status' => false, 'info' => '操作失败']; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
return ['status' => true, 'info' => '操作成功']; |
|||
} |
|||
} |
@ -1,47 +0,0 @@ |
|||
<?php |
|||
|
|||
use yii\helpers\Html; |
|||
use yii\widgets\ActiveForm; |
|||
use \blobt\widgets\DateRangePicker; |
|||
|
|||
/* @var $this yii\web\View */ |
|||
/* @var $model common\models\searchs\BrandSearch */ |
|||
/* @var $form yii\widgets\ActiveForm */ |
|||
?>
|
|||
|
|||
<?php $form = ActiveForm::begin([ |
|||
'action' => ['index'], |
|||
'method' => 'get', |
|||
'validateOnType' => true, |
|||
]); |
|||
?>
|
|||
<div class="col-sm-12"> |
|||
<div class="dataTables_filter"> |
|||
<?= $form->field($model, 'id', [ |
|||
"template" => "{input}{error}", |
|||
"inputOptions" => [ |
|||
"placeholder" => "检索ID", |
|||
"class" => "form-control", |
|||
], |
|||
"errorOptions" => [ |
|||
"class" => "error-tips" |
|||
] |
|||
]) |
|||
?>
|
|||
<?= $form->field($model, "created_at_range", [ |
|||
"template" => "{input}{error}", |
|||
"inputOptions" => [ |
|||
"placeholder" => "创建时间", |
|||
], |
|||
"errorOptions" => [ |
|||
"class" => "error-tips" |
|||
] |
|||
])->widget(DateRangePicker::className()); |
|||
?>
|
|||
<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(); ?>
|
@ -1,38 +0,0 @@ |
|||
<?php |
|||
|
|||
use yii\helpers\Html; |
|||
use yii\widgets\ActiveForm; |
|||
|
|||
/* @var $this yii\web\View */ |
|||
/* @var $model common\models\ars\Category */ |
|||
/* @var $form yii\widgets\ActiveForm */ |
|||
?>
|
|||
|
|||
<div class="category-form"> |
|||
|
|||
<?php $form = ActiveForm::begin(); ?>
|
|||
|
|||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'pid')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'goods_count')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'sort_order')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'icon_type')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'icon')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'is_show')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'is_delete')->textInput() ?>
|
|||
|
|||
<div class="form-group"> |
|||
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
|
|||
<?= Html::a('返回', ['index'], ['class' => 'btn btn-info']) ?>
|
|||
</div> |
|||
|
|||
<?php ActiveForm::end(); ?>
|
|||
|
|||
</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,82 +0,0 @@ |
|||
<?php |
|||
|
|||
use yii\helpers\Html; |
|||
use yii\widgets\ActiveForm; |
|||
|
|||
/* @var $this yii\web\View */ |
|||
/* @var $model common\models\ars\Goods */ |
|||
/* @var $form yii\widgets\ActiveForm */ |
|||
?>
|
|||
|
|||
<div class="goods-form"> |
|||
|
|||
<?php $form = ActiveForm::begin(); ?>
|
|||
|
|||
<?= $form->field($model, 'pid')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'cat_id')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'brand_id')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'shop_cat_id')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'sn')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'code')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'supplier_id')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'weight')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'length')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'width')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'height')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'diameter')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'unit')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'sold_count')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'limit_count')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'stock')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'stock_warn')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'market_price')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'price')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'brief')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'description')->textarea(['rows' => 6]) ?>
|
|||
|
|||
<?= $form->field($model, 'image')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'model_id')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'is_sale')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'sort_order')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'bouns_points')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'experience_points')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'is_delete')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'express_template')->textInput() ?>
|
|||
|
|||
<div class="form-group"> |
|||
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
|
|||
<?= Html::a('返回', ['index'], ['class' => 'btn btn-info']) ?>
|
|||
</div> |
|||
|
|||
<?php ActiveForm::end(); ?>
|
|||
|
|||
</div> |
@ -1,19 +0,0 @@ |
|||
<?php |
|||
|
|||
use iron\widgets\Menu; |
|||
|
|||
?>
|
|||
<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 |
|||
|
|||
?>
|
|||
</section> |
|||
<!-- /.sidebar --> |
|||
</aside> |
@ -1,44 +0,0 @@ |
|||
<?php |
|||
|
|||
use yii\helpers\Html; |
|||
use yii\widgets\ActiveForm; |
|||
|
|||
/* @var $this yii\web\View */ |
|||
/* @var $model common\models\ars\ShopCategory */ |
|||
/* @var $form yii\widgets\ActiveForm */ |
|||
?>
|
|||
|
|||
<div class="shop-category-form"> |
|||
|
|||
<?php $form = ActiveForm::begin(); ?>
|
|||
|
|||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'pid')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'goods_count')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'keywords')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'desc')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'sort_order')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'icon_type')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'icon')->textInput(['maxlength' => true]) ?>
|
|||
|
|||
<?= $form->field($model, 'filter_attr')->textarea(['rows' => 6]) ?>
|
|||
|
|||
<?= $form->field($model, 'is_show')->textInput() ?>
|
|||
|
|||
<?= $form->field($model, 'is_delete')->textInput() ?>
|
|||
|
|||
<div class="form-group"> |
|||
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
|
|||
<?= Html::a('返回', ['index'], ['class' => 'btn btn-info']) ?>
|
|||
</div> |
|||
|
|||
<?php ActiveForm::end(); ?>
|
|||
|
|||
</div> |
@ -1,47 +0,0 @@ |
|||
<?php |
|||
|
|||
use yii\helpers\Html; |
|||
use yii\widgets\ActiveForm; |
|||
use \blobt\widgets\DateRangePicker; |
|||
|
|||
/* @var $this yii\web\View */ |
|||
/* @var $model common\models\searchs\SupplierSearch */ |
|||
/* @var $form yii\widgets\ActiveForm */ |
|||
?>
|
|||
|
|||
<?php $form = ActiveForm::begin([ |
|||
'action' => ['index'], |
|||
'method' => 'get', |
|||
'validateOnType' => true, |
|||
]); |
|||
?>
|
|||
<div class="col-sm-12"> |
|||
<div class="dataTables_filter"> |
|||
<?= $form->field($model, 'id', [ |
|||
"template" => "{input}{error}", |
|||
"inputOptions" => [ |
|||
"placeholder" => "检索ID", |
|||
"class" => "form-control", |
|||
], |
|||
"errorOptions" => [ |
|||
"class" => "error-tips" |
|||
] |
|||
]) |
|||
?>
|
|||
<?= $form->field($model, "created_at_range", [ |
|||
"template" => "{input}{error}", |
|||
"inputOptions" => [ |
|||
"placeholder" => "创建时间", |
|||
], |
|||
"errorOptions" => [ |
|||
"class" => "error-tips" |
|||
] |
|||
])->widget(DateRangePicker::className()); |
|||
?>
|
|||
<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(); ?>
|
Before Width: 1024 | Height: 759 | Size: 159 KiB |
@ -0,0 +1,14 @@ |
|||
<?php |
|||
|
|||
namespace antgoods\goods; |
|||
|
|||
/** |
|||
* This is just an example. |
|||
*/ |
|||
class AutoloadExample extends \yii\base\Widget |
|||
{ |
|||
public function run() |
|||
{ |
|||
return "Hello!"; |
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
商品模块 |
|||
==== |
|||
ant基础模块之一 |
|||
|
|||
Installation |
|||
------------ |
|||
|
|||
The preferred way to install this extension is through [composer](http://getcomposer.org/download/). |
|||
|
|||
Either run |
|||
|
|||
``` |
|||
php composer.phar require --prefer-dist antgoods/goods "*" |
|||
``` |
|||
|
|||
or add |
|||
|
|||
``` |
|||
"antgoods/goods": "*" |
|||
``` |
|||
|
|||
to the require section of your `composer.json` file. |
|||
|
|||
|
|||
Usage |
|||
----- |
|||
|
|||
Once the extension is installed, simply use it in your code by : |
|||
|
|||
```php |
|||
<?= \antgoods\goods\AutoloadExample::widget(); ?>``` |
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue