Browse Source

修改系统逻辑架构,改为1主多module的形式

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
df2124a161
  1. 16
      antgoods/controllers/CategoryController.php
  2. 22
      antgoods/controllers/GoodsController.php
  3. 16
      antgoods/controllers/ShopCategoryController.php
  4. 6
      antgoods/logic/goods/GoodsManager.php
  5. 2
      antgoods/models/ars/Category.php
  6. 2
      antgoods/models/ars/Goods.php
  7. 2
      antgoods/models/ars/ShopCategory.php
  8. 2
      antgoods/views/goods/view.php
  9. 2
      backend/config/main.php
  10. 2
      backend/controllers/ConfigController.php
  11. 12
      backend/controllers/ExpressTemplateController.php
  12. 4
      backend/controllers/OrderController.php
  13. 4
      backend/controllers/SiteController.php
  14. 8
      backend/controllers/TakingSiteController.php
  15. 4
      backend/logic/file/FileManager.php
  16. 0
      backend/migrations/m130524_201442_init.php
  17. 0
      backend/migrations/m140506_102106_rbac_init.php
  18. 0
      backend/migrations/m170907_052038_rbac_add_index_on_auth_assignment_user_id.php
  19. 0
      backend/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php
  20. 0
      backend/migrations/m190124_110200_add_verification_token_column_to_user_table.php
  21. 0
      backend/migrations/m190802_072830_add_category.php
  22. 0
      backend/migrations/m191111_101658_create_table_area.php
  23. 0
      backend/migrations/m191111_102644_create_table_province.php
  24. 0
      backend/migrations/m191111_102730_create_table_city.php
  25. 0
      backend/migrations/m191111_102925_create_table_cart.php
  26. 0
      backend/migrations/m191111_112559_create_table_address.php
  27. 0
      backend/migrations/m191111_113455_create_table_after_sale.php
  28. 0
      backend/migrations/m191112_005106_create_table_search_history.php
  29. 0
      backend/migrations/m191112_005545_create_table_collection.php
  30. 0
      backend/migrations/m191112_005702_create_table_comment.php
  31. 0
      backend/migrations/m191112_010421_create_table_order.php
  32. 0
      backend/migrations/m191112_011517_create_table_order_goods.php
  33. 0
      backend/migrations/m191112_012449_create_table_taking_site.php
  34. 0
      backend/migrations/m191112_014508_create_table_express_template.php
  35. 0
      backend/migrations/m191112_015939_create_table_delivery.php
  36. 0
      backend/migrations/m191112_020830_create_table_payment_log.php
  37. 0
      backend/migrations/m191112_021528_create_table_refund_log.php
  38. 0
      backend/migrations/m191112_022131_create_table_file.php
  39. 0
      backend/migrations/m191112_022532_create_table_tem_file.php
  40. 0
      backend/migrations/m191130_071623_add_column_weight_in_table_ats_order_goods.php
  41. 0
      backend/migrations/m191203_022720_add_column_sku_id_in_table_ats_order_goods.php
  42. 0
      backend/migrations/m191203_030210_update_columns_province_city_area_in_table_ats_taking_site.php
  43. 0
      backend/migrations/m191203_030911_update_column_address_in_table_ats_taking_site.php
  44. 0
      backend/migrations/m191203_031446_drop_column_is_default_in_table_ats_taking_site.php
  45. 0
      backend/migrations/m191203_034004_add_column_address_in_table_ats_order.php
  46. 0
      backend/migrations/m191203_112307_add_data_to_table_city_and_area.php
  47. 0
      backend/migrations/m191203_114421_update_column_discount_description_in_table_order.php
  48. 0
      backend/migrations/m191204_004849_update_column_calculation_in_table_ats_express_template.php
  49. 0
      backend/migrations/m191204_012240_update_columns_basic_price_basic_amount_in_table_ats_express_template.php
  50. 0
      backend/migrations/schema-mysql.sql
  51. 0
      backend/migrations/sql/add_category.sql
  52. 0
      backend/migrations/sql/add_data.sql
  53. 0
      backend/migrations/sql/area.sql
  54. 0
      backend/migrations/sql/city.sql
  55. 0
      backend/migrations/sql/province.sql
  56. 2
      backend/models/Cat.php
  57. 2
      backend/models/Category.php
  58. 6
      backend/models/CategorySearch.php
  59. 2
      backend/models/LoginForm.php
  60. 2
      backend/models/User.php
  61. 2
      backend/models/ars/Address.php
  62. 2
      backend/models/ars/AfterSale.php
  63. 2
      backend/models/ars/Area.php
  64. 2
      backend/models/ars/Cart.php
  65. 2
      backend/models/ars/City.php
  66. 2
      backend/models/ars/Collection.php
  67. 2
      backend/models/ars/Comment.php
  68. 2
      backend/models/ars/Config.php
  69. 2
      backend/models/ars/Delivery.php
  70. 6
      backend/models/ars/ExpressTemplate.php
  71. 2
      backend/models/ars/File.php
  72. 2
      backend/models/ars/Order.php
  73. 2
      backend/models/ars/OrderGoods.php
  74. 2
      backend/models/ars/PaymentLog.php
  75. 2
      backend/models/ars/Province.php
  76. 2
      backend/models/ars/RefundLog.php
  77. 2
      backend/models/ars/SearchHistory.php
  78. 2
      backend/models/ars/TakingSite.php
  79. 2
      backend/models/ars/TemFile.php
  80. 6
      backend/models/searchs/ExpressTemplateSearch.php
  81. 6
      backend/models/searchs/OrderSearch.php
  82. 6
      backend/models/searchs/TakingSiteSearch.php
  83. 96
      backend/views/express-template/_form.php
  84. 2
      backend/views/express-template/_search.php
  85. 2
      backend/views/express-template/area.php
  86. 2
      backend/views/express-template/create.php
  87. 2
      backend/views/express-template/index.php
  88. 2
      backend/views/express-template/update.php
  89. 6
      backend/views/express-template/view.php
  90. 2
      backend/views/order/_form.php
  91. 2
      backend/views/order/_search.php
  92. 2
      backend/views/order/create.php
  93. 2
      backend/views/order/index.php
  94. 2
      backend/views/order/update.php
  95. 2
      backend/views/order/view.php
  96. 2
      backend/views/site/login.php
  97. 2
      backend/views/site/test.php
  98. 4
      backend/views/taking-site/_form.php
  99. 2
      backend/views/taking-site/_search.php
  100. 2
      backend/views/taking-site/create.php

16
antgoods/controllers/CategoryController.php

@ -3,7 +3,7 @@
namespace antgoods\controllers;
use antgoods\logic\goods\GoodsManager;
use common\models\ars\File;
use backend\models\ars\File;
use Yii;
use antgoods\models\ars\Category;
use antgoods\models\searchs\CategorySearch;
@ -193,7 +193,7 @@ class CategoryController extends Controller
*/
public function actionSaveFile()
{
if(!class_exists('\common\models\ars\TemFile') || !class_exists('\backend\logic\file\FileManager')){
if(!class_exists('\backend\models\ars\TemFile') || !class_exists('\backend\logic\file\FileManager')){
return '';
}
@ -201,7 +201,7 @@ class CategoryController extends Controller
$file_name = Yii::$app->request->get('fileName')[0];
if ($data['status'] == true) {
$model = new \common\models\ars\TemFile();
$model = new \backend\models\ars\TemFile();
$model->user_id = Yii::$app->user->identity->id;
$model->name = $file_name;
$file_manager = new \backend\logic\file\FileManager();
@ -223,7 +223,7 @@ class CategoryController extends Controller
public function actionImgIdDel()
{
//判断该类是否存在
if(!class_exists('\common\models\ars\TemFile') || !class_exists('\common\models\ars\File')){
if(!class_exists('\backend\models\ars\TemFile') || !class_exists('\backend\models\ars\File')){
return '';
}
@ -231,13 +231,13 @@ class CategoryController extends Controller
$img_id_arr = explode(',', $img_id);
if(isset(Yii::$app->request->get('data')['alias'])) {
$alias = Yii::$app->request->get('data')['alias'];
$tem_file = \common\models\ars\TemFile::findOne(['alias' => $alias]);
$tem_file = \backend\models\ars\TemFile::findOne(['alias' => $alias]);
if ($tem_file) {
$img_id_arr = array_diff($img_id_arr, [$tem_file->id]);
}
}else{
foreach (Yii::$app->request->get() as $key => $value) {
$tem_file = \common\models\ars\File::findOne(['alias' => $value]);
$tem_file = \backend\models\ars\File::findOne(['alias' => $value]);
if ($tem_file) {
$img_id_arr = array_diff($img_id_arr, [$tem_file->id]);
}
@ -254,13 +254,13 @@ class CategoryController extends Controller
public function actionImageFile()
{
//判断该类是否存在
if(!class_exists('\common\models\ars\File')){
if(!class_exists('\backend\models\ars\File')){
return false;
}
$file_id_str = Yii::$app->request->get('fileidstr');
$file_id_arr = explode(',', $file_id_str);
$data = \common\models\ars\File::find()->where(['id' => $file_id_arr])->all();
$data = \backend\models\ars\File::find()->where(['id' => $file_id_arr])->all();
$res = array();
if($data) {
$i = 0;

22
antgoods/controllers/GoodsController.php

@ -4,8 +4,8 @@ namespace antgoods\controllers;
use antgoods\models\ars\GoodsAttr;
use antgoods\models\ars\GoodsSku;
use common\models\ars\OrderGoods;
use common\models\ars\TemFile;
use backend\models\ars\OrderGoods;
use backend\models\ars\TemFile;
use MongoDB\Driver\Manager;
use Yii;
use antgoods\models\ars\Goods;
@ -14,7 +14,7 @@ use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use antgoods\logic\goods\GoodsManager;
use common\models\ars\File;
use backend\models\ars\File;
use yii\web\Response;
use antgoods\models\ars\Attribute;
@ -203,7 +203,7 @@ class GoodsController extends Controller
*/
public function actionSaveFile()
{
if(!class_exists('\common\models\ars\TemFile') || !class_exists('\backend\logic\file\FileManager')){
if(!class_exists('\backend\models\ars\TemFile') || !class_exists('\backend\logic\file\FileManager')){
return '';
}
@ -211,7 +211,7 @@ class GoodsController extends Controller
$file_name = Yii::$app->request->get('fileName')[0];
if ($data['status'] == true) {
$model = new \common\models\ars\TemFile();
$model = new \backend\models\ars\TemFile();
$model->user_id = Yii::$app->user->identity->id;
$model->name = $file_name;
$file_manager = new \backend\logic\file\FileManager();
@ -233,7 +233,7 @@ class GoodsController extends Controller
public function actionImgIdDel()
{
//判断该类是否存在
if(!class_exists('\common\models\ars\TemFile') || !class_exists('\common\models\ars\File')){
if(!class_exists('\backend\models\ars\TemFile') || !class_exists('\backend\models\ars\File')){
return '';
}
@ -241,13 +241,13 @@ class GoodsController extends Controller
$img_id_arr = explode(',', $img_id);
if(isset(Yii::$app->request->get('data')['alias'])) {
$alias = Yii::$app->request->get('data')['alias'];
$tem_file = \common\models\ars\TemFile::findOne(['alias' => $alias]);
$tem_file = \backend\models\ars\TemFile::findOne(['alias' => $alias]);
if ($tem_file) {
$img_id_arr = array_diff($img_id_arr, [$tem_file->id]);
}
}else{
foreach (Yii::$app->request->get() as $key => $value) {
$tem_file = \common\models\ars\File::findOne(['alias' => $value]);
$tem_file = \backend\models\ars\File::findOne(['alias' => $value]);
if ($tem_file) {
$img_id_arr = array_diff($img_id_arr, [$tem_file->id]);
}
@ -264,7 +264,7 @@ class GoodsController extends Controller
public function actionImageFile()
{
//判断该类是否存在
if(!class_exists('\common\models\ars\File')){
if(!class_exists('\backend\models\ars\File')){
return false;
}
@ -272,9 +272,9 @@ class GoodsController extends Controller
$file_id_str = Yii::$app->request->get('fileidstr');
$file_id_arr = explode(',', $file_id_str);
if ($rule_verify == 1) {
$data = \common\models\ars\TemFile::find()->where(['id' => $file_id_arr])->all();
$data = \backend\models\ars\TemFile::find()->where(['id' => $file_id_arr])->all();
} else {
$data = \common\models\ars\File::find()->where(['id' => $file_id_arr])->all();
$data = \backend\models\ars\File::find()->where(['id' => $file_id_arr])->all();
}
$res = array();
if($data) {

16
antgoods/controllers/ShopCategoryController.php

@ -3,7 +3,7 @@
namespace antgoods\controllers;
use antgoods\logic\goods\GoodsManager;
use common\models\ars\File;
use backend\models\ars\File;
use Yii;
use antgoods\models\ars\ShopCategory;
use antgoods\models\searchs\ShopCategorySearch;
@ -204,7 +204,7 @@ class ShopCategoryController extends Controller
*/
public function actionSaveFile()
{
if(!class_exists('\common\models\ars\TemFile') || !class_exists('\backend\logic\file\FileManager')){
if(!class_exists('\backend\models\ars\TemFile') || !class_exists('\backend\logic\file\FileManager')){
return '';
}
@ -212,7 +212,7 @@ class ShopCategoryController extends Controller
$file_name = Yii::$app->request->get('fileName')[0];
if ($data['status'] == true) {
$model = new \common\models\ars\TemFile();
$model = new \backend\models\ars\TemFile();
$model->user_id = Yii::$app->user->identity->id;
$model->name = $file_name;
$file_manager = new \backend\logic\file\FileManager();
@ -234,7 +234,7 @@ class ShopCategoryController extends Controller
public function actionImgIdDel()
{
//判断该类是否存在
if(!class_exists('\common\models\ars\TemFile') || !class_exists('\common\models\ars\File')){
if(!class_exists('\backend\models\ars\TemFile') || !class_exists('\backend\models\ars\File')){
return '';
}
@ -242,13 +242,13 @@ class ShopCategoryController extends Controller
$img_id_arr = explode(',', $img_id);
if(isset(Yii::$app->request->get('data')['alias'])) {
$alias = Yii::$app->request->get('data')['alias'];
$tem_file = \common\models\ars\TemFile::findOne(['alias' => $alias]);
$tem_file = \backend\models\ars\TemFile::findOne(['alias' => $alias]);
if ($tem_file) {
$img_id_arr = array_diff($img_id_arr, [$tem_file->id]);
}
}else{
foreach (Yii::$app->request->get() as $key => $value) {
$tem_file = \common\models\ars\File::findOne(['alias' => $value]);
$tem_file = \backend\models\ars\File::findOne(['alias' => $value]);
if ($tem_file) {
$img_id_arr = array_diff($img_id_arr, [$tem_file->id]);
}
@ -265,13 +265,13 @@ class ShopCategoryController extends Controller
public function actionImageFile()
{
//判断该类是否存在
if(!class_exists('\common\models\ars\File')){
if(!class_exists('\backend\models\ars\File')){
return false;
}
$file_id_str = Yii::$app->request->get('fileidstr');
$file_id_arr = explode(',', $file_id_str);
$data = \common\models\ars\File::find()->where(['id' => $file_id_arr])->all();
$data = \backend\models\ars\File::find()->where(['id' => $file_id_arr])->all();
$res = array();
if($data) {
$i = 0;

6
antgoods/logic/goods/GoodsManager.php

@ -1,7 +1,7 @@
<?php
namespace antgoods\logic\goods;
use common\models\ars\File;
use backend\models\ars\File;
use Yii;
use yii\base\Exception;
use antgoods\models\ars\GoodsAttr;
@ -24,7 +24,7 @@ class GoodsManager
public static function saveFile($newFileIdArr, $goodsModel, $oldFileIdArr = [], $fileType = 1)
{
//判断类名是否存在
if(!class_exists('\backend\logic\file\FileManager') || !class_exists('\common\models\ars\File')) {
if(!class_exists('\backend\logic\file\FileManager') || !class_exists('\backend\models\ars\File')) {
return ['status' => false, 'info' => '操作失败'];
}
@ -321,7 +321,7 @@ class GoodsManager
/**
* @param $attrId
* @param $goodsId
* @return GoodsAttr[]|GoodsSku[]|array|File[]|\common\models\ars\TemFile[]|\yii\db\ActiveRecord[]
* @return GoodsAttr[]|GoodsSku[]|array|File[]|\backend\models\ars\TemFile[]|\yii\db\ActiveRecord[]
* 获取属性值
*/
public static function getAttrValue($attrId, $goodsId)

2
antgoods/models/ars/Category.php

@ -4,7 +4,7 @@ namespace antgoods\models\ars;
use Yii;
use yii\behaviors\TimestampBehavior;
use common\models\ars\File;
use backend\models\ars\File;
/**
* This is the model class for table "antgoods_category".

2
antgoods/models/ars/Goods.php

@ -6,7 +6,7 @@ use Yii;
use yii\behaviors\TimestampBehavior;
use antgoods\models\ars\Category;
use antgoods\models\ars\ShopCategory;
use common\models\ars\File;
use backend\models\ars\File;
use antgoods\models\ars\Brand;
use antgoods\models\ars\Supplier;

2
antgoods/models/ars/ShopCategory.php

@ -4,7 +4,7 @@ namespace antgoods\models\ars;
use Yii;
use yii\behaviors\TimestampBehavior;
use common\models\ars\File;
use backend\models\ars\File;
/**
* This is the model class for table "antgoods_shop_category".

2
antgoods/views/goods/view.php

@ -3,7 +3,7 @@
use antgoods\models\ars\Goods;
use yii\bootstrap4\Html;
use yii\widgets\DetailView;
use common\models\ars\File;
use backend\models\ars\File;
/* @var $this yii\web\View */
/* @var $model antgoods\models\ars\Goods */

2
backend/config/main.php

@ -22,7 +22,7 @@ return [
'csrfParam' => '_csrf-api',
],
'user' => [
'identityClass' => 'common\models\User',
'identityClass' => 'backend\models\User',
'enableAutoLogin' => true,
'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
],

2
backend/controllers/ConfigController.php

@ -3,7 +3,7 @@
namespace backend\controllers;
use Yii;
use common\models\ars\Category;
use backend\models\ars\Category;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

12
backend/controllers/ExpressTemplateController.php

@ -2,11 +2,11 @@
namespace backend\controllers;
use common\models\ars\City;
use common\models\ars\Province;
use backend\models\ars\City;
use backend\models\ars\Province;
use Yii;
use common\models\ars\ExpressTemplate;
use common\models\searchs\ExpressTemplateSearch;
use backend\models\ars\ExpressTemplate;
use backend\models\searchs\ExpressTemplateSearch;
use yii\caching\Cache;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
@ -72,11 +72,11 @@ class ExpressTemplateController extends Controller
{
$model = new ExpressTemplate();
$model->calculation = ExpressTemplate::CALCULATION_NUMBER;
$model->basic_amount = 0;
$model->basic_amount = 1;
$model->basic_price = '0.00';
if (Yii::$app->request->isPost) {
$data = Yii::$app->request->post('ExpressTemplate');d($data);die();
$data = Yii::$app->request->post('ExpressTemplate');
if (Yii::$app->request->isAjax) {
$model->load($data, '');
Yii::$app->response->format = Response::FORMAT_JSON;

4
backend/controllers/OrderController.php

@ -3,8 +3,8 @@
namespace backend\controllers;
use Yii;
use common\models\ars\Order;
use common\models\searchs\OrderSearch;
use backend\models\ars\Order;
use backend\models\searchs\OrderSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

4
backend/controllers/SiteController.php

@ -6,8 +6,8 @@ use Yii;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use common\models\LoginForm;
use common\models\CategorySearch;
use backend\models\LoginForm;
use backend\models\CategorySearch;
/**
* Site controller

8
backend/controllers/TakingSiteController.php

@ -2,11 +2,11 @@
namespace backend\controllers;
use common\models\ars\Area;
use common\models\ars\City;
use backend\models\ars\Area;
use backend\models\ars\City;
use Yii;
use common\models\ars\TakingSite;
use common\models\searchs\TakingSiteSearch;
use backend\models\ars\TakingSite;
use backend\models\searchs\TakingSiteSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

4
backend/logic/file/FileManager.php

@ -3,8 +3,8 @@
namespace backend\logic\file;
use common\models\ars\File;
use common\models\ars\TemFile;
use backend\models\ars\File;
use backend\models\ars\TemFile;
class FileManager
{

console/migrations/m130524_201442_init.php → backend/migrations/m130524_201442_init.php

console/migrations/m140506_102106_rbac_init.php → backend/migrations/m140506_102106_rbac_init.php

console/migrations/m170907_052038_rbac_add_index_on_auth_assignment_user_id.php → backend/migrations/m170907_052038_rbac_add_index_on_auth_assignment_user_id.php

console/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php → backend/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php

console/migrations/m190124_110200_add_verification_token_column_to_user_table.php → backend/migrations/m190124_110200_add_verification_token_column_to_user_table.php

console/migrations/m190802_072830_add_category.php → backend/migrations/m190802_072830_add_category.php

console/migrations/m191111_101658_create_table_area.php → backend/migrations/m191111_101658_create_table_area.php

console/migrations/m191111_102644_create_table_province.php → backend/migrations/m191111_102644_create_table_province.php

console/migrations/m191111_102730_create_table_city.php → backend/migrations/m191111_102730_create_table_city.php

console/migrations/m191111_102925_create_table_cart.php → backend/migrations/m191111_102925_create_table_cart.php

console/migrations/m191111_112559_create_table_address.php → backend/migrations/m191111_112559_create_table_address.php

console/migrations/m191111_113455_create_table_after_sale.php → backend/migrations/m191111_113455_create_table_after_sale.php

console/migrations/m191112_005106_create_table_search_history.php → backend/migrations/m191112_005106_create_table_search_history.php

console/migrations/m191112_005545_create_table_collection.php → backend/migrations/m191112_005545_create_table_collection.php

console/migrations/m191112_005702_create_table_comment.php → backend/migrations/m191112_005702_create_table_comment.php

console/migrations/m191112_010421_create_table_order.php → backend/migrations/m191112_010421_create_table_order.php

console/migrations/m191112_011517_create_table_order_goods.php → backend/migrations/m191112_011517_create_table_order_goods.php

console/migrations/m191112_012449_create_table_taking_site.php → backend/migrations/m191112_012449_create_table_taking_site.php

console/migrations/m191112_014508_create_table_express_template.php → backend/migrations/m191112_014508_create_table_express_template.php

console/migrations/m191112_015939_create_table_delivery.php → backend/migrations/m191112_015939_create_table_delivery.php

console/migrations/m191112_020830_create_table_payment_log.php → backend/migrations/m191112_020830_create_table_payment_log.php

console/migrations/m191112_021528_create_table_refund_log.php → backend/migrations/m191112_021528_create_table_refund_log.php

console/migrations/m191112_022131_create_table_file.php → backend/migrations/m191112_022131_create_table_file.php

console/migrations/m191112_022532_create_table_tem_file.php → backend/migrations/m191112_022532_create_table_tem_file.php

console/migrations/m191130_071623_add_column_weight_in_table_ats_order_goods.php → backend/migrations/m191130_071623_add_column_weight_in_table_ats_order_goods.php

console/migrations/m191203_022720_add_column_sku_id_in_table_ats_order_goods.php → backend/migrations/m191203_022720_add_column_sku_id_in_table_ats_order_goods.php

console/migrations/m191203_030210_update_columns_province_city_area_in_table_ats_taking_site.php → backend/migrations/m191203_030210_update_columns_province_city_area_in_table_ats_taking_site.php

console/migrations/m191203_030911_update_column_address_in_table_ats_taking_site.php → backend/migrations/m191203_030911_update_column_address_in_table_ats_taking_site.php

console/migrations/m191203_031446_drop_column_is_default_in_table_ats_taking_site.php → backend/migrations/m191203_031446_drop_column_is_default_in_table_ats_taking_site.php

console/migrations/m191203_034004_add_column_address_in_table_ats_order.php → backend/migrations/m191203_034004_add_column_address_in_table_ats_order.php

console/migrations/m191203_112307_add_data_to_table_city_and_area.php → backend/migrations/m191203_112307_add_data_to_table_city_and_area.php

console/migrations/m191203_114421_update_column_discount_description_in_table_order.php → backend/migrations/m191203_114421_update_column_discount_description_in_table_order.php

console/migrations/m191204_004849_update_column_calculation_in_table_ats_express_template.php → backend/migrations/m191204_004849_update_column_calculation_in_table_ats_express_template.php

console/migrations/m191204_012240_update_columns_basic_price_basic_amount_in_table_ats_express_template.php → backend/migrations/m191204_012240_update_columns_basic_price_basic_amount_in_table_ats_express_template.php

console/migrations/schema-mysql.sql → backend/migrations/schema-mysql.sql

console/migrations/sql/add_category.sql → backend/migrations/sql/add_category.sql

console/migrations/sql/add_data.sql → backend/migrations/sql/add_data.sql

console/migrations/sql/area.sql → backend/migrations/sql/area.sql

console/migrations/sql/city.sql → backend/migrations/sql/city.sql

console/migrations/sql/province.sql → backend/migrations/sql/province.sql

common/models/Cat.php → backend/models/Cat.php

common/models/Category.php → backend/models/Category.php

common/models/CategorySearch.php → backend/models/CategorySearch.php

common/models/LoginForm.php → backend/models/LoginForm.php

common/models/User.php → backend/models/User.php

common/models/ars/Address.php → backend/models/ars/Address.php

common/models/ars/AfterSale.php → backend/models/ars/AfterSale.php

common/models/ars/Area.php → backend/models/ars/Area.php

common/models/ars/Cart.php → backend/models/ars/Cart.php

common/models/ars/City.php → backend/models/ars/City.php

common/models/ars/Collection.php → backend/models/ars/Collection.php

common/models/ars/Comment.php → backend/models/ars/Comment.php

common/models/ars/Config.php → backend/models/ars/Config.php

common/models/ars/Delivery.php → backend/models/ars/Delivery.php

common/models/ars/ExpressTemplate.php → backend/models/ars/ExpressTemplate.php

common/models/ars/File.php → backend/models/ars/File.php

common/models/ars/Order.php → backend/models/ars/Order.php

common/models/ars/OrderGoods.php → backend/models/ars/OrderGoods.php

common/models/ars/PaymentLog.php → backend/models/ars/PaymentLog.php

common/models/ars/Province.php → backend/models/ars/Province.php

common/models/ars/RefundLog.php → backend/models/ars/RefundLog.php

common/models/ars/SearchHistory.php → backend/models/ars/SearchHistory.php

common/models/ars/TakingSite.php → backend/models/ars/TakingSite.php

common/models/ars/TemFile.php → backend/models/ars/TemFile.php

common/models/searchs/ExpressTemplateSearch.php → backend/models/searchs/ExpressTemplateSearch.php

common/models/searchs/OrderSearch.php → backend/models/searchs/OrderSearch.php

common/models/searchs/TakingSiteSearch.php → backend/models/searchs/TakingSiteSearch.php

96
backend/views/express-template/_form.php

@ -1,10 +1,10 @@
<?php
use blobt\widgets\Icheck;
use common\models\ars\ExpressTemplate;
use backend\models\ars\ExpressTemplate;
/* @var $this yii\web\View */
/* @var $model common\models\ars\ExpressTemplate */
/* @var $model backend\models\ars\ExpressTemplate */
/* @var $form yii\widgets\ActiveForm */
?>
@ -19,3 +19,95 @@ use common\models\ars\ExpressTemplate;
<?= $form->field($model, 'extra_amount')->textInput() ?>
<?= $form->field($model, 'extra_price')->textInput() ?>
<?php
$js=<<<JS
const formList = [//切换时,class对应的标题
{
"field-expresstemplate-basic_amount":"基本重量(KG)",
"field-expresstemplate-basic_price":"基本运费(元)",
"field-expresstemplate-extra_amount":"续重重量(KG)",
"field-expresstemplate-extra_price":"续重运费(元)"
},
{
"field-expresstemplate-basic_amount":"基本数量(件)",
"field-expresstemplate-basic_price":"基本运费(元)",
"field-expresstemplate-extra_amount":"续重数量(件)",
"field-expresstemplate-extra_price":"续重运费(元)"
}
]
const udfVal = [//初始值
[0.1,"0.00"],
[1,"0.00"]
]
var calType = 1;//初始的计算方式0:计重 1:计件
function changeCalType(type){//当切换计算方式
$.each(formList[type],function(index,value){ //更改文字标题
$("." + index).children("label").html(value)
});
$(".form-control").eq(1).val(udfVal[type][0])//重置初始值
$(".form-control").eq(2).val(udfVal[type][1])
calType = type;
}
$(document).ready(function(){
$(".form-control").eq(1).blur(function(){
if (calType == 0) {
if($(this).val() < 0.1){
$(this).val(0.1)
}
var basicAmount = $(this).val();
$(this).val(Math.floor(basicAmount * 10) / 10);
} else{
if($(this).val() < 1){
$(this).val(1)
}
var basicAmount = $(this).val();
$(this).val(Math.floor(basicAmount * 1) / 1);
}
})
$(".form-control").eq(2).blur(function(){
if($(this).val() < 0){
$(this).val("0.00")
}
var basicPrice = $(this).val();
$(this).val(basicPrice.toString().match(/^\d+(?:\.\d{0,2})?/));
})
$(".form-control").eq(3).blur(function(){
if (calType == 0) {
if($(this).val() < 0){
$(this).val(0)
}
var basicAmount = $(this).val();
$(this).val(Math.floor(basicAmount * 10) / 10);
} else{
if($(this).val() < 0){
$(this).val(0)
}
var basicAmount = $(this).val();
$(this).val(Math.floor(basicAmount * 1) / 1);
}
})
$(".form-control").eq(4).blur(function(){
if($(this).val() < 0){
$(this).val("0.00")
}
var basicPrice = $(this).val();
$(this).val(basicPrice.toString().match(/^\d+(?:\.\d{0,2})?/));
})
$("input:radio[name='ExpressTemplate[calculation]']").on('ifChecked', function(event){
changeCalType($(this).val()-1)
})
changeCalType(calType)
})
JS;
$this->registerJs($js)
?>

2
backend/views/express-template/_search.php

@ -5,7 +5,7 @@ use yii\widgets\ActiveForm;
use \blobt\widgets\DateRangePicker;
/* @var $this yii\web\View */
/* @var $model common\models\searchs\ExpressTemplateSearch */
/* @var $model backend\models\searchs\ExpressTemplateSearch */
/* @var $form yii\widgets\ActiveForm */
?>

2
backend/views/express-template/area.php

@ -206,7 +206,7 @@ xj\babel\BrowserAsset::register($this);
<span>{{province.province}}</span>
</label>
<div
class="glyphicon glyphicon-menu-down switch--popup"
class="fa fa-angle-down switch--popup"
@click="activeProvince = index"
></div>
<transition name="fade">

2
backend/views/express-template/create.php

@ -5,7 +5,7 @@ use yii\bootstrap4\ActiveForm;
use kartik\tabs\TabsX;
/* @var $this yii\web\View */
/* @var $model common\models\ars\ExpressTemplate */
/* @var $model backend\models\ars\ExpressTemplate */
$this->title = '创建运费模板';
$this->params['breadcrumbs'][] = ['label' => 'Express Templates', 'url' => ['index']];

2
backend/views/express-template/index.php

@ -4,7 +4,7 @@ use yii\helpers\Html;
use iron\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\ExpressTemplateSearch */
/* @var $searchModel backend\models\searchs\ExpressTemplateSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '运费模板';

2
backend/views/express-template/update.php

@ -5,7 +5,7 @@ use yii\bootstrap4\ActiveForm;
use kartik\tabs\TabsX;
/* @var $this yii\web\View */
/* @var $model common\models\ars\ExpressTemplate */
/* @var $model backend\models\ars\ExpressTemplate */
$this->title = '编辑运费模板: ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Express Templates', 'url' => ['index']];

6
backend/views/express-template/view.php

@ -2,10 +2,10 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use common\models\ars\ExpressTemplate;
use backend\models\ars\ExpressTemplate;
/* @var $this yii\web\View */
/* @var $model common\models\ars\ExpressTemplate */
/* @var $model backend\models\ars\ExpressTemplate */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Express Templates', 'url' => ['index']];
@ -39,7 +39,7 @@ $this->params['breadcrumbs'][] = $this->title;
'value' => function ($model) {
$array = explode(',', $model->city);
$cities = [];
foreach (\common\models\ars\City::find()->andWhere(['in', 'city_id', $array])->all() as $city) {
foreach (\backend\models\ars\City::find()->andWhere(['in', 'city_id', $array])->all() as $city) {
$cities[] = $city->name;
}
return implode(' // ', $cities);

2
backend/views/order/_form.php

@ -4,7 +4,7 @@ use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
/* @var $model backend\models\ars\Order */
/* @var $form yii\widgets\ActiveForm */
?>

2
backend/views/order/_search.php

@ -5,7 +5,7 @@ use yii\widgets\ActiveForm;
use \blobt\widgets\DateRangePicker;
/* @var $this yii\web\View */
/* @var $model common\models\searchs\OrderSearch */
/* @var $model backend\models\searchs\OrderSearch */
/* @var $form yii\widgets\ActiveForm */
?>

2
backend/views/order/create.php

@ -3,7 +3,7 @@
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
/* @var $model backend\models\ars\Order */
$this->title = '创建 Order';
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];

2
backend/views/order/index.php

@ -4,7 +4,7 @@ use yii\helpers\Html;
use iron\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\OrderSearch */
/* @var $searchModel backend\models\searchs\OrderSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Orders';

2
backend/views/order/update.php

@ -3,7 +3,7 @@
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
/* @var $model backend\models\ars\Order */
$this->title = '编辑 Order: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];

2
backend/views/order/view.php

@ -4,7 +4,7 @@ use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\ars\Order */
/* @var $model backend\models\ars\Order */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];

2
backend/views/site/login.php

@ -1,7 +1,7 @@
<?php
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */
/* @var $model \backend\models\LoginForm */
use yii\helpers\Html;
use yii\bootstrap4\ActiveForm;

2
backend/views/site/test.php

@ -9,7 +9,7 @@ $this->params['subtitle'] = '这是一个小小的测试';
$this->params['breadcrumbs'][] = $this->title;
/* @var $this yii\web\View */
/* @var $model common\models\CategorySearch */
/* @var $model backend\models\CategorySearch */
/* @var $form yii\widgets\ActiveForm */
?>

4
backend/views/taking-site/_form.php

@ -4,12 +4,12 @@ use yii\bootstrap4\Html;
use yii\bootstrap4\ActiveForm;
use blobt\widgets\Icheck;
use kartik\depdrop\DepDrop;
use common\models\ars\Province;
use backend\models\ars\Province;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $model common\models\ars\TakingSite */
/* @var $model backend\models\ars\TakingSite */
/* @var $form yii\widgets\ActiveForm */
$provinces = Province::find()->select('province_id as id,name')->asArray()->all();
$data = ArrayHelper::map($provinces, 'id', 'name');

2
backend/views/taking-site/_search.php

@ -5,7 +5,7 @@ use yii\widgets\ActiveForm;
use \blobt\widgets\DateRangePicker;
/* @var $this yii\web\View */
/* @var $model common\models\searchs\TakingSiteSearch */
/* @var $model backend\models\searchs\TakingSiteSearch */
/* @var $form yii\widgets\ActiveForm */
?>

2
backend/views/taking-site/create.php

@ -3,7 +3,7 @@
use yii\bootstrap4\Html;
/* @var $this yii\web\View */
/* @var $model common\models\ars\TakingSite */
/* @var $model backend\models\ars\TakingSite */
$this->title = '创建 Taking Site';
$this->params['breadcrumbs'][] = ['label' => 'Taking Sites', 'url' => ['index']];

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

Loading…
Cancel
Save