diff --git a/.env.debug b/.env.debug
index 946d744..bb4e9b9 100644
--- a/.env.debug
+++ b/.env.debug
@@ -4,4 +4,58 @@ APP_DEBUG = true
DEFAULT_TIMEZONE = Asia/Shanghai
[LANG]
-default_lang = zh-cn
\ No newline at end of file
+default_lang = zh-cn
+
+[DATABASE]
+TYPE = mysql
+HOSTNAME = 47.92.112.123
+DATABASE = nk_lihaink_cn
+PREFIX = cms_
+USERNAME = nk_lihaink_cn
+PASSWORD = 5MnmkZTW2tmahha7
+HOSTPORT = 3306
+CHARSET = utf8mb4
+DEBUG = true
+
+TYPE = mysql
+HOSTNAME = 47.92.112.123
+DATABASE = nk_lihaink_cn
+PREFIX = cms_
+USERNAME = view_oa_lihaink_cn
+PASSWORD = 5MnmkZTW2tmahha7
+HOSTPORT = 3306
+CHARSET = utf8mb4
+DEBUG = true
+
+[DATABASE]
+TYPE = mysql
+HOSTNAME = 47.92.112.123
+DATABASE = nk_lihaink_cn
+PREFIX = cms_
+USERNAME = view_oa_lihaink_cn
+PASSWORD = 5MnmkZTW2tmahha7
+HOSTPORT = 3306
+CHARSET = utf8mb4
+DEBUG = true
+
+[DATABASESHOP]
+TYPE = mysql
+HOSTNAME = 47.108.186.87
+HOSTPORT = 3306
+USERNAME = shop_lihaink_com
+PASSWORD = EeYym2PFctFfrMde
+DATABASE = shop_lihaink_com
+PREFIX = eb_
+CHARSET = utf8
+DEBUG = true
+
+[DATABASESHOP]
+TYPE = mysql
+HOSTNAME = 122.9.139.134
+HOSTPORT = 3306
+USERNAME = shop_lihaink_com
+PASSWORD = EeYym2PFctFfrMde
+DATABASE = shop_lihaink_com
+PREFIX = eb_
+CHARSET = utf8
+DEBUG = true
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index e64bee4..d1f9879 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,11 +3,17 @@
/.gitee
*.log
*.env
+*.env.debug
*.lock
*.ini
+.htaccess
+404.html
+# index.html
/runtime/*
/public/storage/*
/public/backup/*
/public/static/home/dev
/public/static/home/oa
/config/database.php
+/public/.htaccess
+/public/nginx.htaccess
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..0519ecb
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/404.html b/404.html
new file mode 100644
index 0000000..6f17eaf
--- /dev/null
+++ b/404.html
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/merchant/system/merchant/intention/mark.html b/app/admin/view/merchant/system/merchant/intention/mark.html
new file mode 100644
index 0000000..960b7dc
--- /dev/null
+++ b/app/admin/view/merchant/system/merchant/intention/mark.html
@@ -0,0 +1,57 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+{/block}
+
+
+
+{block name="script"}
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/merchant/system/merchant/margin/edit.html b/app/admin/view/merchant/system/merchant/margin/edit.html
new file mode 100644
index 0000000..dc722a9
--- /dev/null
+++ b/app/admin/view/merchant/system/merchant/margin/edit.html
@@ -0,0 +1,116 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 保证金扣费
+
+
+
+ 扣除保证金
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+{/block}
+
diff --git a/app/admin/view/merchant/system/merchant/margin/list.html b/app/admin/view/merchant/system/merchant/margin/list.html
new file mode 100644
index 0000000..2e94988
--- /dev/null
+++ b/app/admin/view/merchant/system/merchant/margin/list.html
@@ -0,0 +1,523 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/merchant/system/merchant/margin/read.html b/app/admin/view/merchant/system/merchant/margin/read.html
new file mode 100644
index 0000000..1192e1c
--- /dev/null
+++ b/app/admin/view/merchant/system/merchant/margin/read.html
@@ -0,0 +1,102 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+{/block}
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/merchant/system/merchant/margin/read_refund.html b/app/admin/view/merchant/system/merchant/margin/read_refund.html
new file mode 100644
index 0000000..6bb7943
--- /dev/null
+++ b/app/admin/view/merchant/system/merchant/margin/read_refund.html
@@ -0,0 +1,63 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/merchant/system/merchant/type/add.html b/app/admin/view/merchant/system/merchant/type/add.html
new file mode 100644
index 0000000..e2ecbc6
--- /dev/null
+++ b/app/admin/view/merchant/system/merchant/type/add.html
@@ -0,0 +1,209 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 添加店铺类型
+
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+{/block}
+
diff --git a/app/admin/view/merchant/system/merchant/type/index.html b/app/admin/view/merchant/system/merchant/type/index.html
new file mode 100644
index 0000000..c5a0624
--- /dev/null
+++ b/app/admin/view/merchant/system/merchant/type/index.html
@@ -0,0 +1,138 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+{/block}
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/merchant/system/merchant/type/read.html b/app/admin/view/merchant/system/merchant/type/read.html
new file mode 100644
index 0000000..1145f28
--- /dev/null
+++ b/app/admin/view/merchant/system/merchant/type/read.html
@@ -0,0 +1,63 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/Label/add.html b/app/admin/view/product/Label/add.html
new file mode 100644
index 0000000..4465a02
--- /dev/null
+++ b/app/admin/view/product/Label/add.html
@@ -0,0 +1,102 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 添加
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/Label/edit.html b/app/admin/view/product/Label/edit.html
new file mode 100644
index 0000000..cf1d79e
--- /dev/null
+++ b/app/admin/view/product/Label/edit.html
@@ -0,0 +1,97 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/Label/index.html b/app/admin/view/product/Label/index.html
new file mode 100644
index 0000000..f764ee9
--- /dev/null
+++ b/app/admin/view/product/Label/index.html
@@ -0,0 +1,157 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/band/add.html b/app/admin/view/product/band/add.html
new file mode 100644
index 0000000..cd6974f
--- /dev/null
+++ b/app/admin/view/product/band/add.html
@@ -0,0 +1,167 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 添加
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/band/edit.html b/app/admin/view/product/band/edit.html
new file mode 100644
index 0000000..e764766
--- /dev/null
+++ b/app/admin/view/product/band/edit.html
@@ -0,0 +1,165 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/band/index.html b/app/admin/view/product/band/index.html
new file mode 100644
index 0000000..4c48c45
--- /dev/null
+++ b/app/admin/view/product/band/index.html
@@ -0,0 +1,152 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/brand_classify/add.html b/app/admin/view/product/brand_classify/add.html
new file mode 100644
index 0000000..d452070
--- /dev/null
+++ b/app/admin/view/product/brand_classify/add.html
@@ -0,0 +1,122 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 添加
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/brand_classify/edit.html b/app/admin/view/product/brand_classify/edit.html
new file mode 100644
index 0000000..abc9fed
--- /dev/null
+++ b/app/admin/view/product/brand_classify/edit.html
@@ -0,0 +1,119 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/brand_classify/index.html b/app/admin/view/product/brand_classify/index.html
new file mode 100644
index 0000000..d31b0cc
--- /dev/null
+++ b/app/admin/view/product/brand_classify/index.html
@@ -0,0 +1,126 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/classify/add.html b/app/admin/view/product/classify/add.html
new file mode 100644
index 0000000..8468a58
--- /dev/null
+++ b/app/admin/view/product/classify/add.html
@@ -0,0 +1,108 @@
+{extend name="common/base" /}
+
+{block name="body"}
+
+ 添加分类
+
+
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/classify/edit.html b/app/admin/view/product/classify/edit.html
new file mode 100644
index 0000000..5e4547b
--- /dev/null
+++ b/app/admin/view/product/classify/edit.html
@@ -0,0 +1,144 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/classify/index.html b/app/admin/view/product/classify/index.html
new file mode 100644
index 0000000..3d8837c
--- /dev/null
+++ b/app/admin/view/product/classify/index.html
@@ -0,0 +1,143 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/comment/add.html b/app/admin/view/product/comment/add.html
new file mode 100644
index 0000000..b4b9888
--- /dev/null
+++ b/app/admin/view/product/comment/add.html
@@ -0,0 +1,200 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 关联商户
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/comment/edit.html b/app/admin/view/product/comment/edit.html
new file mode 100644
index 0000000..2ebf4e4
--- /dev/null
+++ b/app/admin/view/product/comment/edit.html
@@ -0,0 +1,188 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/comment/index.html b/app/admin/view/product/comment/index.html
new file mode 100644
index 0000000..b369315
--- /dev/null
+++ b/app/admin/view/product/comment/index.html
@@ -0,0 +1,200 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/guarantee/add.html b/app/admin/view/product/guarantee/add.html
new file mode 100644
index 0000000..00125f1
--- /dev/null
+++ b/app/admin/view/product/guarantee/add.html
@@ -0,0 +1,129 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 添加
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/guarantee/edit.html b/app/admin/view/product/guarantee/edit.html
new file mode 100644
index 0000000..a3386d0
--- /dev/null
+++ b/app/admin/view/product/guarantee/edit.html
@@ -0,0 +1,122 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/guarantee/index.html b/app/admin/view/product/guarantee/index.html
new file mode 100644
index 0000000..876d6e5
--- /dev/null
+++ b/app/admin/view/product/guarantee/index.html
@@ -0,0 +1,182 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/mer_specs/add.html b/app/admin/view/product/mer_specs/add.html
new file mode 100644
index 0000000..cd6974f
--- /dev/null
+++ b/app/admin/view/product/mer_specs/add.html
@@ -0,0 +1,167 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 添加
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/mer_specs/edit.html b/app/admin/view/product/mer_specs/edit.html
new file mode 100644
index 0000000..e764766
--- /dev/null
+++ b/app/admin/view/product/mer_specs/edit.html
@@ -0,0 +1,165 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/mer_specs/index.html b/app/admin/view/product/mer_specs/index.html
new file mode 100644
index 0000000..4c48c45
--- /dev/null
+++ b/app/admin/view/product/mer_specs/index.html
@@ -0,0 +1,152 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/parameter/add.html b/app/admin/view/product/parameter/add.html
new file mode 100644
index 0000000..10d3b1a
--- /dev/null
+++ b/app/admin/view/product/parameter/add.html
@@ -0,0 +1,178 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 添加
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/parameter/edit.html b/app/admin/view/product/parameter/edit.html
new file mode 100644
index 0000000..e764766
--- /dev/null
+++ b/app/admin/view/product/parameter/edit.html
@@ -0,0 +1,165 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/parameter/index.html b/app/admin/view/product/parameter/index.html
new file mode 100644
index 0000000..f2173cd
--- /dev/null
+++ b/app/admin/view/product/parameter/index.html
@@ -0,0 +1,195 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/price_description/add.html b/app/admin/view/product/price_description/add.html
new file mode 100644
index 0000000..cd6974f
--- /dev/null
+++ b/app/admin/view/product/price_description/add.html
@@ -0,0 +1,167 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 添加
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/price_description/edit.html b/app/admin/view/product/price_description/edit.html
new file mode 100644
index 0000000..e764766
--- /dev/null
+++ b/app/admin/view/product/price_description/edit.html
@@ -0,0 +1,165 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/price_description/index.html b/app/admin/view/product/price_description/index.html
new file mode 100644
index 0000000..4c48c45
--- /dev/null
+++ b/app/admin/view/product/price_description/index.html
@@ -0,0 +1,152 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/product/add.html b/app/admin/view/product/product/add.html
new file mode 100644
index 0000000..b4b9888
--- /dev/null
+++ b/app/admin/view/product/product/add.html
@@ -0,0 +1,200 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 关联商户
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/product/edit.html b/app/admin/view/product/product/edit.html
new file mode 100644
index 0000000..2ebf4e4
--- /dev/null
+++ b/app/admin/view/product/product/edit.html
@@ -0,0 +1,188 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/product/index.back.html b/app/admin/view/product/product/index.back.html
new file mode 100644
index 0000000..d3dced9
--- /dev/null
+++ b/app/admin/view/product/product/index.back.html
@@ -0,0 +1,437 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/product/product/index.html b/app/admin/view/product/product/index.html
new file mode 100644
index 0000000..7a9d803
--- /dev/null
+++ b/app/admin/view/product/product/index.html
@@ -0,0 +1,449 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+ 出售中的商品
+ 仓库中的商品
+ 已售罄的商品
+ 警戒库存
+ 待审核商品
+ 审核未通过商品
+ 回收站商品
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/supplychain/index/add.html b/app/admin/view/supplychain/index/add.html
new file mode 100644
index 0000000..0e5787b
--- /dev/null
+++ b/app/admin/view/supplychain/index/add.html
@@ -0,0 +1,210 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 关联商户
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/supplychain/index/edit.html b/app/admin/view/supplychain/index/edit.html
new file mode 100644
index 0000000..0ed608a
--- /dev/null
+++ b/app/admin/view/supplychain/index/edit.html
@@ -0,0 +1,218 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+
+ 编辑
+
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/supplychain/index/index.html b/app/admin/view/supplychain/index/index.html
new file mode 100644
index 0000000..ac0d49c
--- /dev/null
+++ b/app/admin/view/supplychain/index/index.html
@@ -0,0 +1,208 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/supplychain/index/read.html b/app/admin/view/supplychain/index/read.html
new file mode 100644
index 0000000..3fffad9
--- /dev/null
+++ b/app/admin/view/supplychain/index/read.html
@@ -0,0 +1,67 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+{/block}
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/supplychain/merchant/add.html b/app/admin/view/supplychain/merchant/add.html
new file mode 100644
index 0000000..a408038
--- /dev/null
+++ b/app/admin/view/supplychain/merchant/add.html
@@ -0,0 +1,138 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 添加
+
+
+ 立即提交
+ 重置
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/supplychain/merchant/bill.html b/app/admin/view/supplychain/merchant/bill.html
new file mode 100644
index 0000000..d1e1ab5
--- /dev/null
+++ b/app/admin/view/supplychain/merchant/bill.html
@@ -0,0 +1,280 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/supplychain/merchant/edit.html b/app/admin/view/supplychain/merchant/edit.html
new file mode 100644
index 0000000..a27228d
--- /dev/null
+++ b/app/admin/view/supplychain/merchant/edit.html
@@ -0,0 +1,133 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+ 编辑
+
+
+
+ 立即提交
+ 重置
+
+
+{/block}
+
+
+
+{block name="script"}
+
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/supplychain/merchant/index.html b/app/admin/view/supplychain/merchant/index.html
new file mode 100644
index 0000000..0ec5f85
--- /dev/null
+++ b/app/admin/view/supplychain/merchant/index.html
@@ -0,0 +1,259 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/supplychain/merchant/read.html b/app/admin/view/supplychain/merchant/read.html
new file mode 100644
index 0000000..3fffad9
--- /dev/null
+++ b/app/admin/view/supplychain/merchant/read.html
@@ -0,0 +1,67 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+{/block}
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/api/BaseController.php b/app/api/BaseController.php
index bea59e9..823bf71 100644
--- a/app/api/BaseController.php
+++ b/app/api/BaseController.php
@@ -83,52 +83,62 @@ abstract class BaseController
//每页显示数据量
$this->pageSize = Request::param('page_size', \think\facade\Config::get('app.page_size'));
- $token = Request::header('x-Token');
- if ($token) {
- if (strpos($token, 'Bearer') === 0){
- $token = trim(substr($token, 6));
- }
- if (count(explode('.', $token)) != 3) {
- return json(['code'=>404,'msg'=>'非法请求']);
- }
- $config = get_system_config('token');
- //var_dump($config);exit;
- try {
- JWT::$leeway = 60;//当前时间减去60,把时间留点余地
- $decoded = JWT::decode($token, new Key('ae47e94a7dcd1fdfacb499b60e361a8d', 'HS256')); //HS256方式,这里要和签发的时候对应
+// 暂时去除 -----------------------------------------------------
+// $token = Request::header('x-Token');
+// if ($token) {
+// if (strpos($token, 'Bearer') === 0){
+// $token = trim(substr($token, 6));
+// }
+// if (count(explode('.', $token)) != 3) {
+// return json(['code'=>404,'msg'=>'非法请求']);
+// }
+// $config = get_system_config('token');
- //return (array)$decoded;
-// $decoded_array = json_decode(json_encode($decoded),TRUE);
-// $jwt_data = $decoded_array['data'];
+// return json($token);
+// JWT::$leeway = 60;//当前时间减去60,把时间留点余地
+// $decoded = JWT::decode($token, new Key('ae47e94a7dcd1fdfacb499b60e361a8d', 'HS256')); //HS256方式,这里要和签发的时候对应
- $user=Db::connect('shop')->name('nk_user')->where('user_id',$decoded->jti[0])->find();
- if (!$user){
- return json(['code'=>403,'msg'=>'签名错误']);
- return false;
- }
- $user = Db::table('fa_user')->where('id',$user['n_user_id'])->find();
- //$request->uid = $jwt_data['userid'];
- define('JWT_UID', $user['id']);
-// $response = $next($request);
-// return $response;
- //return $next($request);
- } catch(\Firebase\JWT\SignatureInvalidException $e) { //签名不正确
- return json(['code'=>403,'msg'=>'签名错误']);
- }catch(\Firebase\JWT\BeforeValidException $e) { // 签名在某个时间点之后才能用
- return json(['code'=>401,'msg'=>'token失效']);
- }catch(\Firebase\JWT\ExpiredException $e) { // token过期
- return json(['code'=>401,'msg'=>'token已过期']);
- }catch(Exception $e) { //其他错误
- return json(['code'=>404,'msg'=>'非法请求']);
- }catch(\UnexpectedValueException $e) { //其他错误
- return json(['code'=>404,'msg'=>'非法请求']);
- } catch(\DomainException $e) { //其他错误
- return json(['code'=>404,'msg'=>'非法请求']);
- }
- }else{
- define('JWT_UID', '');
- }
+// return $decoded->jti[0];
+// exit;
+// //var_dump($config);exit;
+// try {
+// JWT::$leeway = 60;//当前时间减去60,把时间留点余地
+// $decoded = JWT::decode($token, new Key('ae47e94a7dcd1fdfacb499b60e361a8d', 'HS256')); //HS256方式,这里要和签发的时候对应
+
+// //return (array)$decoded;
+// // $decoded_array = json_decode(json_encode($decoded),TRUE);
+// // $jwt_data = $decoded_array['data'];
+
+// $user=Db::connect('shop')->name('nk_user')->where('user_id',$decoded->jti[0])->find();
+// if (!$user){
+// return json(['code'=>403,'msg'=>'签名错误']);
+// return false;
+// }
+// $user = Db::table('fa_user')->where('id',$user['n_user_id'])->find();
+// //$request->uid = $jwt_data['userid'];
+// define('JWT_UID', $user['id']);
+// // $response = $next($request);
+// // return $response;
+// //return $next($request);
+// } catch(\Firebase\JWT\SignatureInvalidException $e) { //签名不正确
+// return json(['code'=>403,'msg'=>'签名错误']);
+// }catch(\Firebase\JWT\BeforeValidException $e) { // 签名在某个时间点之后才能用
+// return json(['code'=>401,'msg'=>'token失效']);
+// }catch(\Firebase\JWT\ExpiredException $e) { // token过期
+// return json(['code'=>401,'msg'=>'token已过期']);
+// }catch(Exception $e) { //其他错误
+// return json(['code'=>404,'msg'=>'非法请求']);
+// }catch(\UnexpectedValueException $e) { //其他错误
+// return json(['code'=>404,'msg'=>'非法请求']);
+// } catch(\DomainException $e) { //其他错误
+// return json(['code'=>404,'msg'=>'非法请求']);
+// }
+// }else{
+// define('JWT_UID', '');
+// }
+
+// 暂时去除 -----------------------------------------------------
}
/**
diff --git a/app/api/controller/Article.php b/app/api/controller/Article.php
index 5659497..f3fe1f4 100644
--- a/app/api/controller/Article.php
+++ b/app/api/controller/Article.php
@@ -41,8 +41,8 @@ class Article extends BaseController
unset($where[1]);
}
//根据个人村id进行查询
- if (JWT_UID) {
- $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
+ if ($this->request->uid) {
+ $find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
if ($find) {
if ($find['auth_range']==1){
$where[] = ['village', '=', $find['village_id']];
@@ -54,7 +54,7 @@ class Article extends BaseController
}
// 登录返回村名和村地址
$cun_arr['cun_name'] = Db::table('fa_geo_village')->where('village_id', $find['village_id'])->value('village_name');
- $cun_arr['cun_address'] = Db::table('fa_szxc_information_usermsg')->where('user_id', JWT_UID)->value('address_name');
+ $cun_arr['cun_address'] = Db::table('fa_szxc_information_usermsg')->where('user_id', $this->request->uid)->value('address_name');
}else{
$cun_arr = [];
}
@@ -183,8 +183,8 @@ class Article extends BaseController
unset($where[1]);
}
// 如果登录
- if (JWT_UID) {
- $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
+ if ($this->request->uid) {
+ $find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
if ($find) {
if ($find['auth_range']==1){
$where[] = ['village', '=', $find['village_id']];
@@ -312,8 +312,8 @@ class Article extends BaseController
['status', '=', 1],
];
//根据个人村id进行查询
- if (JWT_UID) {
- $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
+ if ($this->request->uid) {
+ $find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
if ($find) {
if ($find['auth_range']==1){
$where[] = ['village', '=', $find['village_id']];
@@ -497,7 +497,7 @@ class Article extends BaseController
// if (!$res) {
// return $this->apiError($valdate->getError());
// }
- $useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->where('status', 1)->find();
+ $useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->where('status', 1)->find();
$data = [];
if ($useraddress) {
@@ -507,7 +507,7 @@ class Article extends BaseController
}
$data['end_time'] = date('Y-m-d H:i:s', strtotime('+1 day'));
$data['view_time'] = date('Y-m-d H:i:s');
- $data['user_id'] = JWT_UID;//添加用户的id
+ $data['user_id'] = $this->request->uid;//添加用户的id
$data['category_id'] = $input['category_id'];//大分类id
$data['category_type'] = $input['category_type'];//小分类id
$data['title'] = $input['title'];//标题
@@ -518,7 +518,7 @@ class Article extends BaseController
$data['image'] = $input['image'];//封面
$data['is_vote'] =empty($input['is_vote'])?0:$input['is_vote'];//是否投票
if ($input['category_id']==150){
- $name=Db::table('fa_szxc_information_usermsg')->where('user_id',JWT_UID)->value('name');
+ $name=Db::table('fa_szxc_information_usermsg')->where('user_id',$this->request->uid)->value('name');
$data['title'] = '来自于'.$name.'的一键求救';
}
$res = Db::table('fa_article')->insertGetId($data);
@@ -575,7 +575,7 @@ class Article extends BaseController
$data['describe'] = empty($input['describe'])?'':$input['describe'];//简介
$data['image'] = $input['image'];//封面
$data['is_vote'] = $input['is_vote'];//是否投票
- $input['update_user_id'] = JWT_UID;//更新用户的id
+ $input['update_user_id'] = $this->request->uid;//更新用户的id
$res = Db::table('fa_article')->where('id', $id)->update($data);
if ($input['is_vote'] == 1) {
@@ -596,8 +596,8 @@ class Article extends BaseController
{
// $model = Db::table('fa_article');
//根据个人村id进行查询
- if (JWT_UID) {
- $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
+ if ($this->request->uid) {
+ $find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
if ($find) {
if ($find['auth_range']==1){
$where[] = ['village', '=', $find['village_id']];
@@ -650,12 +650,12 @@ class Article extends BaseController
{
// $model = Db::table('fa_article');
//根据个人id进行查询
- $where[] = ['a.user_id','=',JWT_UID];
+ $where[] = ['a.user_id','=',$this->request->uid];
$where[] = ['b.is_read','=','0'];
$which = [];
//根据个人村id进行查询
- if (JWT_UID) {
- $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
+ if ($this->request->uid) {
+ $find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
if ($find) {
if ($find['auth_range']==1){
$www[] = ['a.village', '=', $find['village_id']];
@@ -665,7 +665,7 @@ class Article extends BaseController
$www[] = ['a.county', '=', $find['area_id']];
}
}
- $which['user_id'] = JWT_UID;
+ $which['user_id'] = $this->request->uid;
}
$yishi = Db::table('fa_article')->alias('a')->join(['fa_article_vote_side_tables' => 'b'],'a.id=b.article_id')->where($www)->where('a.category_id',162)->whereTime('b.end_time', '>', date('Y-m-d H:i:s'))->count();
$maodun = Db::table('fa_article')->alias('a')->join(['fa_article_comment' => 'b'],'a.id=b.vote_id')->where('a.is_solve', 1)->where($where)->where('a.category_id',147)->count();
@@ -708,8 +708,8 @@ class Article extends BaseController
}
//根据个人村id进行查询
- if (JWT_UID) {
- $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
+ if ($this->request->uid) {
+ $find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
if ($find) {
if ($find['auth_range']==1){
$where[] = ['village', '=', $find['village_id']];
@@ -721,7 +721,7 @@ class Article extends BaseController
}
// 登录返回村名和村地址
$cun_arr['cun_name'] = Db::table('fa_geo_village')->where('village_id', $find['village_id'])->value('village_name');
- $cun_arr['cun_address'] = Db::table('fa_szxc_information_usermsg')->where('user_id', JWT_UID)->value('address_name');
+ $cun_arr['cun_address'] = Db::table('fa_szxc_information_usermsg')->where('user_id', $this->request->uid)->value('address_name');
}else{
$cun_arr = [];
}
diff --git a/app/api/controller/Geo.gc.php b/app/api/controller/Geo.gc.php
new file mode 100644
index 0000000..55e48b1
--- /dev/null
+++ b/app/api/controller/Geo.gc.php
@@ -0,0 +1,96 @@
+ ['except' => ['province','city','area','street','village','brigade'] ]
+ ];
+
+ /**
+ * 省
+ */
+ public function province(){
+ $res = Db::table('fa_geo_province')->where(['switch'=>1])
+ ->field('province_id id,province_code code,province_name name')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+ /**
+ * 市
+ */
+ public function city(){
+ $pcode = get_params('pcode');
+ // $pcode = '130000';
+ if(!$pcode) $this->apiError('请先选择省份');
+ $res = Db::table('fa_geo_city')->where(['switch'=>1,'province_code'=>$pcode])
+ ->field('city_id id,city_code code,city_name name')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+ /**
+ * 区
+ */
+ public function area(){
+ $pcode = get_params('pcode');
+ // $pcode = '140100';
+ if(!$pcode) $this->apiError('请先选择城市');
+ $res = Db::table('fa_geo_area')->where(['switch'=>1,'city_code'=>$pcode])
+ ->field('area_id id,area_code code,area_name name')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+ /**
+ * 街道
+ */
+ public function street(){
+ $pcode = get_params('pcode');
+ // $pcode = '410102';
+ if(!$pcode) $this->apiError('请先选择区/县');
+ $res = Db::table('fa_geo_street')->where(['switch'=>1,'area_code'=>$pcode])
+ ->field('street_id id,street_code code,street_name name')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+ /**
+ * 村
+ */
+ public function village(){
+ $pcode = get_params('pcode');
+ // $pcode = '410102';
+ if(!$pcode) $this->apiError('请先选择镇/街道');
+ $res = Db::table('fa_geo_village')->where(['switch'=>1,'street_code'=>$pcode])
+ ->field('village_id id,village_code code,village_name name')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+ /**
+ * 大队
+ */
+ public function brigade(){
+
+ $res = Db::table('fa_geo_brigade')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+
+}
diff --git a/app/api/controller/Geo.php b/app/api/controller/Geo.php
index 55e48b1..1480db5 100644
--- a/app/api/controller/Geo.php
+++ b/app/api/controller/Geo.php
@@ -1,96 +1,129 @@
- ['except' => ['province','city','area','street','village','brigade'] ]
- ];
-
- /**
- * 省
- */
- public function province(){
- $res = Db::table('fa_geo_province')->where(['switch'=>1])
- ->field('province_id id,province_code code,province_name name')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
- /**
- * 市
- */
- public function city(){
- $pcode = get_params('pcode');
- // $pcode = '130000';
- if(!$pcode) $this->apiError('请先选择省份');
- $res = Db::table('fa_geo_city')->where(['switch'=>1,'province_code'=>$pcode])
- ->field('city_id id,city_code code,city_name name')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
- /**
- * 区
- */
- public function area(){
- $pcode = get_params('pcode');
- // $pcode = '140100';
- if(!$pcode) $this->apiError('请先选择城市');
- $res = Db::table('fa_geo_area')->where(['switch'=>1,'city_code'=>$pcode])
- ->field('area_id id,area_code code,area_name name')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
- /**
- * 街道
- */
- public function street(){
- $pcode = get_params('pcode');
- // $pcode = '410102';
- if(!$pcode) $this->apiError('请先选择区/县');
- $res = Db::table('fa_geo_street')->where(['switch'=>1,'area_code'=>$pcode])
- ->field('street_id id,street_code code,street_name name')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
- /**
- * 村
- */
- public function village(){
- $pcode = get_params('pcode');
- // $pcode = '410102';
- if(!$pcode) $this->apiError('请先选择镇/街道');
- $res = Db::table('fa_geo_village')->where(['switch'=>1,'street_code'=>$pcode])
- ->field('village_id id,village_code code,village_name name')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
- /**
- * 大队
- */
- public function brigade(){
-
- $res = Db::table('fa_geo_brigade')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
-
-}
+市->区->街道/农村->大队
+ */
+namespace app\api\controller;
+
+
+use app\api\BaseController;
+use app\api\middleware\Auth;
+use app\common\model\geo\GeoProvince as GeoProvinceModel;
+use app\common\model\geo\GeoCity as GeoCityModel;
+use app\common\model\geo\GeoArea as GeoAreaModel;
+use app\common\model\geo\GeoStreet as GeoStreetModel;
+use app\common\model\geo\GeoVillage as GeoVillageModel;
+use app\common\model\geo\GeoBrigade as GeoBrigadeModel;
+
+
+/**
+ * 首页接口
+ */
+class Geo extends BaseController
+{
+
+ /**
+ * 控制器中间件 [不需要鉴权]
+ * @var array
+ */
+ protected $middleware = [
+ Auth::class => ['except' => ['Province','City','Area','Street','Village', 'Brigade','test']]
+ ];
+
+ /**
+ * 省
+ *
+ * echo json
+ */
+ function Province(GeoProvinceModel $province){
+ $list = $province::Get();
+
+ $this->apiSuccess('OK',$list);
+ }
+
+ /**
+ * 市
+ *
+ * @param $pcode 码
+ *
+ * @echo json
+ */
+ function City(GeoCityModel $city){
+ $pcode = get_params('pcode');
+ // $pcode = '130000';
+ if(!$pcode) $this->apiError('请先选择省份');
+
+ $list = $city::Get($pcode);
+
+ $this->apiSuccess('OK',$list);
+ }
+
+ /**
+ * 区
+ *
+ * @param $pcode 码
+ *
+ * echo json
+ */
+ function Area(GeoAreaModel $area){
+ $pcode = get_params('pcode');
+ // $pcode = '140100';
+ if(!$pcode) $this->apiError('请先选择城市');
+
+ $list = $area::Get($pcode);
+
+ $this->apiSuccess('OK',$list);
+ }
+
+ /**
+ * 镇/街道
+ *
+ * @param $pcode 码
+ *
+ * echo json
+ */
+ function Street(GeoStreetModel $street){
+ $pcode = get_params('pcode');
+ // $pcode = '410102';
+ if(!$pcode) $this->apiError('请先选择镇/街道');
+
+ $list = $street::Get($pcode);
+
+ $this->apiSuccess('OK',$list);
+ }
+
+ /**
+ * 村
+ *
+ * @param $pcode 码
+ *
+ * echo json
+ */
+ function Village(GeoVillageModel $village){
+ $pcode = get_params('pcode');
+ // $pcode = '410102';
+ if(!$pcode) $this->apiError('请先选择镇/街道');
+
+ $list = $village::Get($pcode);
+
+ $this->apiSuccess('OK',$list);
+ }
+
+
+ /**
+ * 大队
+ *
+ * @param $pcode 码
+ *
+ * echo json
+ */
+ function Brigade(GeoBrigadeModel $brigade) {
+ $list = $brigade::Get();
+
+ $this->apiSuccess('OK',$list);
+ }
+
+}
\ No newline at end of file
diff --git a/app/api/controller/User.php b/app/api/controller/User.php
index 513804a..aa4346b 100644
--- a/app/api/controller/User.php
+++ b/app/api/controller/User.php
@@ -29,9 +29,9 @@ class User extends BaseController
* 会员中心.
*/
public function index()
- {
- $user = Db::table('fa_user')->where('id',JWT_UID)->find();
- $user_msg = Db::table('fa_szxc_information_usermsg')->where('user_id',JWT_UID)->field('id,name,address_name,phone')->find();
+ {
+ $user = Db::table('fa_user')->where('id', $this->request->uid)->find();
+ $user_msg = Db::table('fa_szxc_information_usermsg')->where('user_id', $this->request->uid)->field('id,name,address_name,phone')->find();
$this->apiSuccess('', [
'nickname' => $user['nickname'],
'phone'=>$user_msg['phone'],
@@ -472,7 +472,7 @@ class User extends BaseController
// 获取实名认证信息
public function get_shiming(){
- $uid = JWT_UID;
+ $uid = $this->request->uid;
$is_have = Db::table('cms_szxc_user_authentication')->where('user_id',$uid)->find();
if($is_have){
$this->apiSuccess('获取成功',$is_have);
@@ -483,7 +483,7 @@ class User extends BaseController
// 获取后台账号信息
public function get_backstage(){
- $uid = JWT_UID;
+ $uid = $this->request->uid;
$admin = Db::table('cms_admin')->where('user_id',$uid)->find();
if($admin){
$data['url'] = 'https://nk.lihaink.cn';
diff --git a/app/api/controller/Userinfo.php b/app/api/controller/Userinfo.php
index a3da625..7617a8b 100644
--- a/app/api/controller/Userinfo.php
+++ b/app/api/controller/Userinfo.php
@@ -94,16 +94,17 @@ class Userinfo extends BaseController
public function Binding()
{
$post = get_params();
-
if(!$post['idcard'] || !$post['area_id'] || !$post['street_id'] || !$post['village_id'] || !$post['name']){
$this->apiError('缺少参数');
}
if($post['phone'] == 'undefined'){
$this->apiError('手机号错误');
}
+
$where['id'] = $this->request->uid;
$post['user_id'] = $this->request->uid;
$user = Db::table('fa_user')->where($where)->field('id,nickname,group_id,mobile,avatar,username,createtime,score')->find();
+
// 已绑定
if ($user) {
Db::startTrans();
diff --git a/app/api/controller/Village.php b/app/api/controller/Village.php
index 27cd03d..f0981ec 100644
--- a/app/api/controller/Village.php
+++ b/app/api/controller/Village.php
@@ -664,7 +664,7 @@ class Village extends BaseController
})
->withAttr('is_dz', function ($value, $data) {
// 判断redis
- $user_id = JWT_UID;
+ $user_id = $this->request->uid;
if($user_id){
$name = $user_id . $data['id'];
$is_zan = Cache::store('redis')->get($name);
diff --git a/app/api/middleware.php b/app/api/middleware.php
index 91dea02..e695fbe 100644
--- a/app/api/middleware.php
+++ b/app/api/middleware.php
@@ -6,4 +6,6 @@ return [
//验证勾股cms是否完成安装
\app\home\middleware\Install::class,
\app\api\middleware\AllowOriginMiddleware::class,
+ \app\api\middleware\Auth::class,
+
];
\ No newline at end of file
diff --git a/app/api/middleware/Auth.php b/app/api/middleware/Auth.php
index 6b55e8c..bfe148d 100644
--- a/app/api/middleware/Auth.php
+++ b/app/api/middleware/Auth.php
@@ -27,11 +27,12 @@ class Auth
if (count(explode('.', $token)) != 3) {
return json(['code'=>404,'msg'=>'非法请求']);
}
+
try {
JWT::$leeway = 60;//当前时间减去60,把时间留点余地
$decoded = JWT::decode($token, new Key('ae47e94a7dcd1fdfacb499b60e361a8d', 'HS256')); //HS256方式,这里要和签发的时候对应
$user=Db::connect('shop')->name('nk_user')->where('user_id',$decoded->jti[0])->find();
- if ($user &&$user['n_user_id']!=0){
+ if ($user && $user['n_user_id']!=0){
$request->uid=$user['n_user_id'];
}else{
$request->uid=$this->addUser($decoded->jti[0],$user);
@@ -61,41 +62,41 @@ class Auth
$msg=Db::table('fa_szxc_information_usermsg')->where('phone',$user['account'])->find();
Db::startTrans();
try {
- if ($msg){
- $users=Db::table('fa_user')->where('id',$msg['user_id'])->find();
- if (!$nk_user){
+ if ($msg){
+ $users=Db::table('fa_user')->where('id',$msg['user_id'])->find();
+ if (!$nk_user){
+ $datas=[
+ 'user_id'=>$user['uid'],
+ 'n_user_id'=>$msg['user_id'],
+ 'group_id'=>$users['group_id']
+ ];
+ Db::connect('shop')->name('nk_user')->insert($datas);
+ }else{
+ Db::connect('shop')->name('nk_user')->where('id',$nk_user['id'])->update(['user_id'=>$user['uid'],'group_id'=>$users['group_id']]);
+ }
+ }else{
+ $time=time();
+ $user_data=[
+ 'openid'=>'wx'.$time,
+ 'group_id'=>1,
+ 'username'=>'wx'.$time,
+ 'nickname'=>'微信用户'.$time,
+ 'avatar'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230104/32a639be4ee32349705e947fbbd1e114.png',
+ 'level'=>1,
+ 'prevtime'=>$time,
+ 'jointime'=>$time,
+ 'createtime'=>$time,
+ 'updatetime'=>$time,
+ 'status'=>'normal'
+ ];
+ $n_user_id= Db::table('fa_user')->insertGetId($user_data);
$datas=[
'user_id'=>$user['uid'],
- 'n_user_id'=>$msg['user_id'],
- 'group_id'=>$users['group_id']
+ 'n_user_id'=>$n_user_id,
+ 'group_id'=>1
];
Db::connect('shop')->name('nk_user')->insert($datas);
- }else{
- Db::connect('shop')->name('nk_user')->where('id',$nk_user['id'])->update(['user_id'=>$user['uid'],'group_id'=>$users['group_id']]);
- }
- }else{
- $time=time();
- $user_data=[
- 'openid'=>'wx'.$time,
- 'group_id'=>1,
- 'username'=>'wx'.$time,
- 'nickname'=>'微信用户'.$time,
- 'avatar'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230104/32a639be4ee32349705e947fbbd1e114.png',
- 'level'=>1,
- 'prevtime'=>$time,
- 'jointime'=>$time,
- 'createtime'=>$time,
- 'updatetime'=>$time,
- 'status'=>'normal'
- ];
- $n_user_id= Db::table('fa_user')->insertGetId($user_data);
- $datas=[
- 'user_id'=>$user['uid'],
- 'n_user_id'=>$n_user_id,
- 'group_id'=>1
- ];
- Db::connect('shop')->name('nk_user')->insert($datas);
- return $n_user_id;
+ return $n_user_id;
}
Db::commit();
} catch (\Exception $e) {
diff --git a/app/common/controller/FormatList.php b/app/common/controller/FormatList.php
new file mode 100644
index 0000000..991e56b
--- /dev/null
+++ b/app/common/controller/FormatList.php
@@ -0,0 +1,77 @@
+ $v) {
+ if ($v['pid'] == $pid) {
+ $v['title'] = '';
+ if ($pid != 0) {
+ $v['title'] = $space[$level] . $v['title'];
+ }
+ /*将该类别的数据放入list中*/
+ $list[] = $v;
+ self::DropDownMenu($data, $v['id'],$level);
+ }
+ }
+
+ return $list;
+ }
+}
\ No newline at end of file
diff --git a/app/common/model/geo/GeoArea.php b/app/common/model/geo/GeoArea.php
new file mode 100644
index 0000000..c1ca65e
--- /dev/null
+++ b/app/common/model/geo/GeoArea.php
@@ -0,0 +1,26 @@
+1,'city_code'=>$pcode])
+ ->field('area_id id,area_code code,area_name name')
+ ->select();
+
+ return $list;
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/common/model/geo/GeoBrigade.php b/app/common/model/geo/GeoBrigade.php
new file mode 100644
index 0000000..ec7385a
--- /dev/null
+++ b/app/common/model/geo/GeoBrigade.php
@@ -0,0 +1,22 @@
+1,'province_code'=>$pcode])
+ ->field('city_id id,city_code code,city_name name')
+ ->select();
+
+ return $list;
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/common/model/geo/GeoProvince.php b/app/common/model/geo/GeoProvince.php
new file mode 100644
index 0000000..5d5d161
--- /dev/null
+++ b/app/common/model/geo/GeoProvince.php
@@ -0,0 +1,31 @@
+belongsToMany(User::class,'fa_geo_city','user_id','role_id');
+ // }
+
+ /**
+ * 省
+ */
+ static function Get(){
+ $res = self::where(['switch'=>1])
+ ->field('province_id id,province_code code,province_name name')
+ ->select();
+
+ return $res;
+ }
+
+}
\ No newline at end of file
diff --git a/app/common/model/geo/GeoStreet.php b/app/common/model/geo/GeoStreet.php
new file mode 100644
index 0000000..cf9b998
--- /dev/null
+++ b/app/common/model/geo/GeoStreet.php
@@ -0,0 +1,23 @@
+1,'area_code'=>$pcode])
+ ->field('street_id id,street_code code,street_name name')
+ ->select();
+
+ return $list;
+ }
+}
\ No newline at end of file
diff --git a/app/common/model/geo/GeoVillage.php b/app/common/model/geo/GeoVillage.php
new file mode 100644
index 0000000..20d98f1
--- /dev/null
+++ b/app/common/model/geo/GeoVillage.php
@@ -0,0 +1,25 @@
+1,'street_code'=>$pcode])
+ ->field('village_id id,village_code code,village_name name')
+ ->select();
+
+ return $list;
+ }
+}
\ No newline at end of file
diff --git a/app/common/model/merchant/system/Relevance.php b/app/common/model/merchant/system/Relevance.php
new file mode 100644
index 0000000..e2681b9
--- /dev/null
+++ b/app/common/model/merchant/system/Relevance.php
@@ -0,0 +1,104 @@
+hasOne(User::class,'uid','left_id');
+ }
+
+ public function focus()
+ {
+ return $this->hasOne(User::class,'uid','right_id');
+ }
+
+ public function community()
+ {
+ return $this->hasOne(Community::class,'community_id','right_id')
+ ->bind(['community_id','title','image','start','uid','create_time','count_start','author','is_type']);
+ }
+
+ public function getIsStartAttr()
+ {
+ return self::where('left_id', $this->right_id)
+ ->where('right_id',$this->left_id)
+ ->where('type', 'fans')
+ ->count() > 0;
+ }
+
+ public function spu()
+ {
+ return $this->hasOne(Spu::class, 'spu_id','right_id');
+ }
+ public function merchant()
+ {
+ return $this->hasOne(Merchant::class, 'mer_id','right_id');
+ }
+
+ public function category()
+ {
+ return $this->hasOne(StoreCategory::class, 'store_category_id','right_id');
+ }
+
+
+ public function auth()
+ {
+ return $this->hasOne(Menu::class, 'menu_id','right_id');
+ }
+
+ public function searchLeftIdAttr($query, $value)
+ {
+ $query->where('left_id', $value);
+ }
+
+ public function searchRightIdAttr($query, $value)
+ {
+ $query->where('right_id', $value);
+ }
+
+ public function searchTypeAttr($query, $value)
+ {
+ $query->where('type', $value);
+ }
+
+}
diff --git a/app/common/model/merchant/system/auth/Menu.php b/app/common/model/merchant/system/auth/Menu.php
new file mode 100644
index 0000000..82aaff3
--- /dev/null
+++ b/app/common/model/merchant/system/auth/Menu.php
@@ -0,0 +1,108 @@
+field('menu_id as id,pid, sort, route as src,icon,menu_name as title,is_show as status, is_menu as menu')
+ ->order('sort DESC,menu_id ASC');
+ if (isset($where['pid'])) $query->where('pid', (int)$where['pid']);
+ if (isset($where['keyword'])) $query->whereLike('menu_name|route', "%{$where['keyword']}%");
+ if (isset($where['is_menu'])) $query->where('is_menu', (int)$where['is_menu']);
+
+ // 查询记录总行数
+ $count = $query->count();
+
+ if (isset($where['offset'])) $query->page($where['offset'])->limit($where['limit']);
+
+ // 隐藏指定字段
+ $list = $query->hidden(['update_time', 'path'])->select()->toArray();
+ // 合并为一个数组并返回
+ $data = compact('count', 'list');
+
+ return $data;
+ }
+
+ /**
+ * 获取指定行数据
+ *
+ * @return array $row
+ */
+ function Find($id) {
+ $row = self::where('menu_id', $id)
+ ->field('menu_id as id,pid, sort, route as src,icon,menu_name as title,is_show as status, is_menu as menu')
+ ->find();
+
+ return $row;
+ }
+
+ /**
+ * 添加
+ */
+ function Add() {}
+
+ /**
+ * 更新
+ */
+ function modify()
+ {
+ return true;
+ }
+
+ /**
+ * 删除指定菜单项
+ * 由于有三种结果,建议用 try{}catch() 捕获
+ *
+ * @return bool||throw Exception
+ */
+ function Del($id)
+ {
+ $count = self::where(["pid" => $id])->count();
+ if ($count > 0) {
+ throw new ValidateException('该节点下还有子节点,无法删除');
+ return false;
+ }
+ if (self::delete($id) !== false) {
+ clear_cache('adminRules');
+ add_log('delete', $id, []);
+ throw new ValidateException('删除节点成功');
+ } else {
+ throw new ValidateException('删除失败');
+ return false;
+ }
+ return true;
+ }
+
+}
diff --git a/app/common/model/merchant/system/auth/Role.php b/app/common/model/merchant/system/auth/Role.php
new file mode 100644
index 0000000..97c3196
--- /dev/null
+++ b/app/common/model/merchant/system/auth/Role.php
@@ -0,0 +1,14 @@
+hasOne(MerchantType::class, 'mer_type_id', 'type_id');
+ }
+
+ public function typeName()
+ {
+ return $this->merchantType()->bind(['type_name']);
+ }
+
+ /**
+ * 扣除保证金
+ *@param array $data [mer_id] => 75
+ [number] => 2
+ [mer_name] => teert
+ [margin] => 10
+ [mark] => qweqer
+ [title] => 保证金扣除
+ [balance] => 8.00
+ *@return
+ */
+ public function SetMargin($data)
+ {
+ $merchant = $this->GetMerchantById($data['mer_id']);
+
+ if ($merchant->is_margin !== 10) {
+ throw new ValidateException('商户未支付保证金或已申请退款');
+ }
+ if ($data['number'] < 0) {
+ throw new ValidateException('扣除保证金额不能小于0');
+ }
+
+ if (bccomp($merchant->margin, $data['number'], 2) == -1) {
+ throw new ValidateException('扣除保证金额不足');
+ }
+
+ $data['balance'] = bcsub($merchant->margin, $data['number'], 2);
+
+ Merchant::transaction(function () use ($merchant, $data) {
+ $merchant->margin = $data['balance'];
+ $merchant->save();
+ $bill = new UserBillModel();
+ $bill->Bill(0, 'mer_margin', $data['type'], 0, $data);
+ });
+
+ // return [];
+ }
+
+ /**
+ * 查询指定商户信息
+ */
+ public function GetMerchantById($mer_id)
+ {
+ $merchant = Merchant::where('mer_id', $mer_id)->find();
+
+ return $merchant;
+ }
+}
diff --git a/app/common/model/merchant/system/merchant/MerchantAdmin.php b/app/common/model/merchant/system/merchant/MerchantAdmin.php
new file mode 100644
index 0000000..03ec84b
--- /dev/null
+++ b/app/common/model/merchant/system/merchant/MerchantAdmin.php
@@ -0,0 +1,14 @@
+hasOne(MerchantCategory::class, 'merchant_category_id', 'merchant_category_id');
+ }
+
+ protected function merchantType()
+ {
+ return $this->hasOne(MerchantType::class, 'mer_type_id', 'mer_type_id');
+ }
+
+
+ /**
+ * 查询入驻申请列表
+ */
+ public function GetList(array $where, $page, $limit)
+ {
+ $query = self::search($where);
+
+ $count = $query->count();
+ $list = $query->page($page, $limit)->order('create_time DESC , status ASC')->with(['merchantCategory', 'merchantType'])->select();
+
+ return compact('count', 'list');
+ }
+
+
+ /**
+ * 查询条件组合
+ * @param array $where 查询条件
+ * @return mixed $query
+ */
+ protected function search(array $where)
+ {
+ $query = self::when(isset($where['mer_id']) && $where['mer_id'] !== '',
+ function ($query) use ($where) {
+ $query->where('mer_id', $where['mer_id']);
+ })
+ ->when(isset($where['uid']) && $where['uid'] !== '',
+ function ($query) use ($where) {
+ $query->where('uid', $where['uid']);
+ })
+ ->when(isset($where['status']) && $where['status'] !== '',
+ function ($query) use ($where) {
+ $query->where('status', (int)$where['status']);
+ })
+ ->when(isset($where['mer_intention_id']) && $where['mer_intention_id'] !== '',
+ function ($query) use ($where) {
+ $query->where('mer_intention_id', $where['mer_intention_id']);
+ })
+ ->when(isset($where['category_id']) && $where['category_id'] !== '',
+ function ($query) use ($where) {
+ $query->where('merchant_category_id', $where['category_id']);
+ })
+ ->when(isset($where['type_id']) && $where['type_id'] !== '',
+ function ($query) use ($where) {
+ $query->where('mer_type_id', $where['type_id']);
+ })
+ ->when(isset($where['keyword']) && $where['keyword'] !== '',
+ function ($query) use ($where) {
+ $query->where('mer_name|phone|mark', 'like', '%' . $where['keyword'] . '%');
+ })
+ ->when(isset($where['date']) && $where['date'] !== '',
+ function ($query) use ($where) {
+ getModelTime($query, $where['date']);
+ }
+ )
+ ->where('is_del', 0);
+
+ return $query;
+ }
+
+ public function Edit($id, $data)
+ {
+ $rows = self::where('mer_intention_id',$id)->update($data);
+ return $rows;
+ }
+
+ public function form($id, $data)
+ {
+ $this->getModel()::getDB()->where($this->getPk(), $id)->update(['status' => $data['status'], 'mark' => $data['mark']]);
+ }
+
+ public function GetWhereCount($mer_intention_id)
+ {
+ $count = self::where(['mer_intention_id' => $mer_intention_id, 'is_del' => 0])->fetchSql()->count();
+
+ return $count;
+ }
+}
diff --git a/app/common/model/merchant/system/merchant/MerchantType.php b/app/common/model/merchant/system/merchant/MerchantType.php
new file mode 100644
index 0000000..569a134
--- /dev/null
+++ b/app/common/model/merchant/system/merchant/MerchantType.php
@@ -0,0 +1,144 @@
+order('mer_type_id DESC')
+ ->page($page)
+ ->limit($limit)
+ ->order('mer_type_id DESC')->paginate($rows, false,[
+ 'query' => [], //url额外参数
+ // 'total' => '', //最大数量
+ // 'fragment' => '', //url锚点
+ // 'var_page' => 'page', //分页变量
+ ]);
+
+ return $data;
+ }
+
+ /**
+ * 查询指定店铺类型数据
+ *
+ * @param int $page 过滤字段条件
+ * @param int $limit 菜单类型: 0商城平台菜单 1商户菜单
+ *
+ * @return array|object
+ */
+ function Find(int $id)
+ {
+ if (empty($id)) {
+ throw new ValidateException('未传递参数');
+ return [];
+ }
+ $row = self::where('mer_type_id', $id)->field('mer_type_id as id,type_name,margin,type_info,description,is_margin,create_time,update_time')->find();
+
+ return $row;
+ }
+
+ /**
+ * 新增店铺类型数据
+ *
+ * @param int $page 过滤字段条件
+ * @param int $limit 菜单类型: 0商城平台菜单 1商户菜单
+ *
+ * @return array|object
+ */
+ function Add(array $set_data) {
+ if (empty($set_data['type_name'])) {
+ return 0;
+ }
+ $batch['type_name'] = $set_data['type_name'];
+ $batch['description'] = empty($set_data['description'])?"":$set_data['description'];
+ $batch['is_margin'] = empty($set_data['is_margin']);
+ if (!empty($set_data['is_margin'])) {
+ $batch['margin'] = empty($set_data['margin'])?0:$set_data['margin'];
+ }
+ $batch['type_info'] = empty($set_data['type_info'])?'':$set_data['type_info'];
+ $batch['create_time'] = date('Y-m-d H:i:s',time());
+ $batch['update_time'] = date('Y-m-d H:i:s',time());
+
+ $rows = self::insert($batch);
+
+ return $rows;
+ }
+
+ /**
+ * 更新指定店铺类型数据
+ *
+ * @param int $page 过滤字段条件
+ * @param int $limit 菜单类型: 0商城平台菜单 1商户菜单
+ *
+ * @return array|object
+ */
+ function Edit(int $id, array $set_data) {
+ if (empty($id) || empty($set_data['type_name'])) {
+ throw new ValidateException('未传递参数');
+ return 0;
+ }
+
+ $batch['type_name'] = $set_data['type_name'];
+ $batch['description'] = empty($set_data['description'])?"":$set_data['description'];
+ $batch['is_margin'] = empty($set_data['is_margin']);
+ if (!empty($set_data['is_margin'])) {
+ $batch['margin'] = empty($set_data['margin'])?0:$set_data['margin'];
+ }
+ $batch['type_info'] = empty($set_data['type_info'])?'':$set_data['type_info'];
+ $batch['update_time'] = date('Y-m-d H:i:s',time());
+
+ $rows = self::update($batch)->where('mer_type_id', $id)->limit(1);
+
+ return $rows;
+ }
+
+ /**
+ * 删除指定店铺类型数据
+ *
+ * @param int $page 过滤字段条件
+ * @param int $limit 菜单类型: 0商城平台菜单 1商户菜单
+ *
+ * @return array|object
+ */
+ function Del(int $id) {
+ if (empty($id)) {
+ throw new ValidateException('未传递参数');
+ return 0;
+ }
+ $rows = self::where('mer_type_id', $id)->delete();
+
+ return $rows;
+ }
+
+
+}
diff --git a/app/common/model/merchant/system/serve/ServeMeal.php b/app/common/model/merchant/system/serve/ServeMeal.php
new file mode 100644
index 0000000..b971529
--- /dev/null
+++ b/app/common/model/merchant/system/serve/ServeMeal.php
@@ -0,0 +1,14 @@
+hasOne(Merchant::class,'mer_id','mer_id');
+ }
+
+ // 关联用户表
+ public function userInfo()
+ {
+ return $this->hasOne(User::class,'mer_id','ud');
+ }
+
+ function GetList($where, int $page, int $limit)
+ {
+ $where['is_del'] = 0;
+
+ $query = self::Search($where)->with([
+ 'merchant' => function($query){
+ $query->with(['merchantType']);
+ $query->field('mer_id,mer_name,is_trader,mer_avatar,type_id,mer_phone,mer_address,is_margin,margin,real_name,ot_margin');
+ }
+ ])->order('ServeOrder.create_time DESC');
+
+ $count = $query->count();
+ $list = $query->page((int)$page, (int)$limit)->select();
+
+ return compact('count','list');
+ }
+
+
+ /**
+ * @param ServeOrderRepository $orderRepository
+ *
+ * @return \think\response\Json
+ */
+ public function Search($where):Query
+ {
+ $query = self::hasWhere('merchant',function($query) use($where) {
+
+ $query->when(isset($where['keyword']) && $where['keyword'] !== '',
+ function ($query) use($where){
+ $query->whereLike('mer_keyword|real_name|mer_name',"%{$where['keyword']}%");
+ }
+ );
+ $query->when(isset($where['is_trader']) && $where['is_trader'] !== '',
+ function ($query) use($where){
+ $query->where('is_trader',$where['is_trader']);
+ }
+ );
+ $query->when(isset($where['category_id']) && $where['category_id'] !== '',
+ function ($query) use($where){
+ $query->where('category_id',$where['category_id']);
+ }
+ );
+ $query->when(isset($where['type_id']) && $where['type_id'] !== '',
+ function ($query) use($where){
+ $query->where('type_id',$where['type_id']);
+ }
+ );
+ $query->where('is_del',0);
+ });
+
+ $query->when(isset($where['type']) && $where['type'] !== '',
+ function ($query) use($where){
+ $query->where('ServeOrder.type',$where['type']);
+ }
+ );
+
+ $query->when(isset($where['date']) && $where['date'] !== '',
+ function ($query) use($where){
+ getModelTime($query,$where['date'],'ServeOrder.create_time');
+ }
+ );
+
+ $query->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use($where){
+ $query->where('ServeOrder.mer_id',$where['mer_id']);
+ });
+
+ $query->when(isset($where['status']) && $where['status'] !== '', function ($query) use($where){
+ $query->where('ServeOrder.status',$where['status']);
+ });
+
+ $query->when(isset($where['is_del']) && $where['is_del'] !== '', function ($query) use($where){
+ $query->where('ServeOrder.is_del',$where['is_del']);
+ });
+
+ return $query;
+ }
+}
diff --git a/app/common/model/merchant/user/User.php b/app/common/model/merchant/user/User.php
new file mode 100644
index 0000000..a0031f5
--- /dev/null
+++ b/app/common/model/merchant/user/User.php
@@ -0,0 +1,15 @@
+ '佣金转入余额',
+ 'brokerage/order_one' => '获得一级推广佣金',
+ 'brokerage/order_two' => '获得二级推广佣金',
+ 'brokerage/refund_one' => '退还一级佣金',
+ 'brokerage/refund_two' => '退还二级佣金',
+ 'integral/cancel' => '退回积分',
+ 'integral/deduction' => '购买商品',
+ 'integral/lock' => '下单赠送积分',
+ 'integral/refund' => '订单退款',
+ 'integral/refund_lock' => '扣除赠送积分',
+ 'integral/sign_integral' => '签到赠送积分',
+ 'integral/spread' => '邀请好友',
+ 'integral/sys_dec' => '系统减少积分',
+ 'integral/sys_inc' => '系统增加积分',
+ 'integral/timeout' => '积分过期',
+ 'mer_integral/deduction' => '积分抵扣',
+ 'mer_integral/refund' => '订单退款',
+ 'mer_lock_money/order' => '商户佣金冻结',
+ 'now_money/brokerage' => '佣金转入余额',
+ 'now_money/pay_product' => '购买商品',
+ 'now_money/presell' => '支付预售尾款',
+ 'now_money/recharge' => '余额充值',
+ 'now_money/sys_dec_money' => '系统减少余额',
+ 'now_money/sys_inc_money' => '系统增加余额',
+ ];
+
+
+ /**
+ * TODO: 短信通知待开发
+ * 创建用户帐单
+ *
+ * @param int $uid
+ * @param string $category
+ * @param string $type
+ * @param int $pm
+ * @param array $data
+ * @return BaseDao|Model
+ */
+ public function Bill(int $uid, string $category, string $type, int $pm, array $data)
+ {
+ $data['category'] = $category;
+ $data['type'] = $type;
+ $data['uid'] = $uid;
+ $data['pm'] = $pm;
+ $bill = self::create($data);
+ if($category == 'now_money'){
+ // 暂不发短信
+ // Queue::push(SendSmsJob::class,['tempId' => 'USER_BALANCE_CHANGE','id' => $bill->bill_id]);
+ }
+ return $bill;
+ }
+
+
+ // protected function getModel(): string
+ // {
+ // return UserBill::class;
+ // }
+
+ /**
+ * 获取查询用户保证金帐单记录
+ * @param array $where 查询条件
+ * @param int $page 当前页
+ * @param int $limit 每页记录数
+ *
+ * @return array
+ */
+ public function GetList($where, $page, $limit)
+ {
+ $query = self::SearchJoin($where)->order('a.create_time DESC');
+ $count = $query->count();
+ $list = $query->page($page, $limit)->select();
+
+ return compact('count', 'list');
+ }
+
+ /**
+ * @param array $where
+ * @param $data
+ * @return int
+ * @throws \think\db\exception\DbException
+ * @author xaboy
+ * @day 2020/6/22
+ */
+ public function updateBill(array $where, $data)
+ {
+ return UserBill::where($where)->limit(1)->update($data);
+ }
+
+
+ /**
+ * 查询历史佣金记录
+ *
+ * @param $time
+ * @return \think\Collection
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
+ * @author xaboy
+ * @day 2020/6/22
+ */
+ public function getTimeoutBrokerageBill($time)
+ {
+ return UserBill::where('create_time', '<=', $time)->where('category', 'brokerage')
+ ->whereIn('type', ['order_one', 'order_two'])->with('user')->where('status', 0)->select();
+ }
+
+ /**
+ * 查询历史积分记录
+ */
+ public function getTimeoutIntegralBill($time)
+ {
+ return UserBill::where('create_time', '<=', $time)->where('category', 'integral')
+ ->where('type', 'lock')->with('user')->where('status', 0)->select();
+ }
+
+ public function getTimeoutMerchantMoneyBill($time)
+ {
+ return UserBill::where('create_time', '<=', $time)->where('category', 'mer_computed_money')->where('type','order')
+ ->where('status', 0)->select();
+ }
+
+ public function refundMerchantMoney($order_id, $type, $mer_id)
+ {
+ return UserBill::where('link_id', $order_id)->where('mer_id', $mer_id)
+ ->where('category', 'mer_refund_money')->where('type', $type)->sum('number');
+ }
+
+ public function merchantLickMoney($merId = null)
+ {
+ $lst = UserBill::where('category', 'mer_lock_money')->when($merId, function ($query, $val) {
+ $query->where('mer_id', $val);
+ })->where('status', 0)->select()->toArray();
+ $lockMoney = 0;
+ if (count($lst)) {
+ $lockMoney = -1 * UserBill::whereIn('link_id', array_column($lst, 'link_id'))
+ ->where('category', 'mer_refund_money')->sum('number');
+ }
+ foreach ($lst as $bill) {
+ $lockMoney = bcadd($lockMoney, $bill['number'], 2);
+ }
+ $lockMoney = bcadd($lockMoney, UserBill::getDB()
+ ->where('category', 'mer_computed_money')->when($merId, function ($query, $val) {
+ $query->where('mer_id', $val);
+ })->where('status', 0)->where('type', 'order')->sum('number'), 2);
+ return $lockMoney;
+ }
+
+ /**
+ * @param $uid
+ * @return float
+ * @author xaboy
+ * @day 2020/6/22
+ */
+ public function lockBrokerage($uid)
+ {
+ $lst = UserBill::where('category', 'brokerage')
+ ->whereIn('type', ['order_one', 'order_two'])->where('uid', $uid)->where('status', 0)->field('link_id,number')->select()->toArray();
+ $refundPrice = 0;
+ if (count($lst)) {
+ $refundPrice = -1 * UserBill::whereIn('link_id', array_column($lst, 'link_id'))->where('uid', $uid)
+ ->where('category', 'brokerage')->whereIn('type', ['refund_two', 'refund_one'])->sum('number');
+ }
+ foreach ($lst as $bill) {
+ $refundPrice = bcadd($refundPrice, $bill['number'], 2);
+ }
+ return $refundPrice;
+ }
+
+ public function lockIntegral($uid = null, $order_id = null)
+ {
+ $lst = UserBill::where('category', 'integral')
+ ->where('type', 'lock')->when($order_id, function ($query, $order_id) {
+ $query->where('link_id', $order_id);
+ })->when($uid, function ($query, $uid) {
+ $query->where('uid', $uid);
+ })->where('status', 0)->field('link_id,number')->select()->toArray();
+ $lockIntegral = 0;
+ if (count($lst)) {
+ $lockIntegral = -1 * UserBill::whereIn('link_id', array_column($lst, 'link_id'))->where('uid', $uid)
+ ->where('category', 'integral')->where('type', 'refund_lock')->sum('number');
+ }
+ foreach ($lst as $bill) {
+ $lockIntegral = bcadd($lockIntegral, $bill['number'], 0);
+ }
+ return $lockIntegral;
+ }
+
+ public function deductionIntegral($uid)
+ {
+ return UserBill::where('uid', $uid)
+ ->where('category', 'integral')->where('type', 'deduction')->sum('number');
+ }
+
+ public function totalGainIntegral($uid)
+ {
+ return UserBill::where('uid', $uid)
+ ->where('category', 'integral')->where('pm', 1)->whereNotIn('type', ['refund', 'cancel'])->sum('number');
+ }
+
+ /**
+ * @param $uid
+ * @return float
+ * @author xaboy
+ * @day 2020/6/22
+ */
+ public function totalBrokerage($uid)
+ {
+ return bcsub(UserBill::where('category', 'brokerage')
+ ->whereIn('type', ['order_one', 'order_two'])->where('uid', $uid)->sum('number'),
+ UserBill::where('uid', $uid)
+ ->where('category', 'brokerage')->whereIn('type', ['refund_two', 'refund_one'])->sum('number'), 2);
+ }
+
+ /**
+ * @param $uid
+ * @return float
+ * @author xaboy
+ * @day 2020/6/22
+ */
+ public function yesterdayBrokerage($uid)
+ {
+ return getModelTime(UserBill::where('category', 'brokerage')
+ ->whereIn('type', ['order_one', 'order_two'])->where('uid', $uid), 'yesterday')->sum('number');
+ }
+
+ /**
+ * @param array $where
+ * @return \think\db\BaseQuery
+ * @author xaboy
+ * @day 2020/6/22
+ */
+ public function search(array $where)
+ {
+ return UserBill::when(isset($where['now_money']) && in_array($where['now_money'], [0, 1, 2]), function ($query) use ($where) {
+ if ($where['now_money'] == 0)
+ $query->where('category', 'now_money')->whereIn('type', ['pay_product', 'recharge', 'sys_inc_money', 'sys_dec_money', 'brokerage', 'presell', 'refund']);
+ else if ($where['now_money'] == 1)
+ $query->where('category', 'now_money')->whereIn('type', ['pay_product', 'sys_dec_money', 'presell']);
+ else if ($where['now_money'] == 2)
+ $query->where('category', 'now_money')->whereIn('type', ['recharge', 'sys_inc_money', 'brokerage', 'refund']);
+ })
+ ->when(isset($where['uid']) && $where['uid'] !== '', function ($query) use ($where) {
+ $query->where('uid', $where['uid'])->where('mer_id', 0);
+ })
+ ->when(isset($where['pm']) && $where['pm'] !== '', function ($query) use ($where) {
+ $query->where('pm', $where['pm']);
+ })
+ ->when(isset($where['category']) && $where['category'] !== '', function ($query) use ($where) {
+ $query->where('category', $where['category']);
+ })
+ ->when(isset($where['status']) && $where['status'] !== '', function ($query) use ($where) {
+ $query->where('status', $where['status']);
+ })
+ ->when(isset($where['date']) && $where['date'] !== '', function ($query) use ($where) {
+ getModelTime($query, $where['date'], 'create_time');
+ })
+ ->when(isset($where['day']) && $where['day'] !== '', function ($query) use ($where) {
+ $query->whereDay('create_time', $where['day']);
+ })
+ ->when(isset($where['month']) && $where['month'] !== '', function ($query) use ($where) {
+ $query->whereMonth('create_time', $where['month']);
+ })
+ ->when(isset($where['type']) && $where['type'] !== '', function ($query) use ($where) {
+ $data = explode('/', $where['type'], 2);
+ if (count($data) > 1) {
+ $query->where('category', $data[0])->where('type', $data[1]);
+ } else {
+ $query->where('type', $where['type']);
+ }
+ })
+ ->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use ($where) {
+ $query->where('mer_id', $where['mer_id']);
+ })
+ ->when(isset($where['link_id']) && $where['link_id'] !== '', function ($query) use ($where) {
+ $query->where('link_id', $where['link_id']);
+ });
+ }
+
+ public function userNowMoneyIncTotal($uid)
+ {
+ return $this->search(['uid' => $uid, 'now_money' => 2])->sum('number');
+ }
+
+ /**
+ * 查询用户帐单
+ * @param array $where 查询条件
+ * @return Query
+ */
+ public function SearchJoin(array $where)
+ {
+ $query = UserBill::alias('a')->leftJoin('User b', 'a.uid = b.uid')
+ ->field('a.bill_id,a.pm,a.title,a.number,a.balance,a.mark,a.create_time,a.status,b.nickname,a.uid,a.category')
+ ->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use ($where) {
+ $query->where('a.mer_id', $where['mer_id']);
+ })
+ ->when(isset($where['type']) && $where['type'] !== '', function ($query) use ($where) {
+ $data = explode('/', $where['type'], 2);
+ if (count($data) > 1) {
+ $query->where('a.category', $data[0])->where('type', $data[1]);
+ } else {
+ $query->where('a.type', $where['type']);
+ }
+ })
+ ->when(isset($where['date']) && $where['date'] !== '', function ($query) use ($where) {
+ getModelTime($query, $where['date'], 'a.create_time');
+ })
+ ->when(isset($where['keyword']) && $where['keyword'] !== '', function ($query) use ($where) {
+ $query->whereLike('a.uid|b.nickname|a.title', "%{$where['keyword']}%");
+ })
+ ->when(isset($where['category']) && $where['category'] !== '', function ($query) use ($where) {
+ $query->where('a.category', $where['category']);
+ })->where('category', '<>', 'sys_brokerage');
+
+ return $query;
+ }
+
+ public function refundBrokerage($order_id, $uid)
+ {
+ return UserBill::where('link_id', $order_id)->where('uid', $uid)
+ ->where('category', 'brokerage')->whereIn('type', ['refund_two', 'refund_one'])->sum('number');
+ }
+
+ public function refundIntegral($order_id, $uid)
+ {
+ return UserBill::where('link_id', $order_id)->where('uid', $uid)
+ ->where('category', 'integral')->where('type', 'refund_lock')->sum('number');
+ }
+
+ public function validIntegral($uid, $start, $end)
+ {
+ $lst = UserBill::where('category', 'integral')
+ ->where('type', 'lock')->whereBetween('create_time', [$start, $end])->where('uid', $uid)->where('status', 1)->field('link_id,number')->select()->toArray();
+ $integral = 0;
+ if (count($lst)) {
+ $integral = -1 * UserBill::whereIn('link_id', array_column($lst, 'link_id'))->where('uid', $uid)
+ ->where('category', 'integral')->where('type', 'refund_lock')->sum('number');
+ }
+ foreach ($lst as $bill) {
+ $integral = bcadd($integral, $bill['number'], 0);
+ }
+ $integral2 = UserBill::where('uid', $uid)->whereBetween('create_time', [$start, $end])
+ ->where('category', 'integral')->where('pm', 1)->whereNotIn('type', ['lock', 'refund'])->sum('number');
+ $integral3 = UserBill::where('uid', $uid)->whereBetween('create_time', [$start, $end])
+ ->where('category', 'integral')->where('type', 'sys_dec')->sum('number');
+ return (int)max(bcsub(bcadd($integral, $integral2, 0), $integral3, 0), 0);
+ }
+}
diff --git a/app/common/model/merchant/user/UserHistory.php b/app/common/model/merchant/user/UserHistory.php
new file mode 100644
index 0000000..6a56744
--- /dev/null
+++ b/app/common/model/merchant/user/UserHistory.php
@@ -0,0 +1,14 @@
+hasOne(User::class, 'uid', 'uid');
+ }
+
+ /**
+ * @param $value
+ * @return array
+ * @author xaboy
+ * @day 2020-05-09
+ */
+ public function getLabelIdAttr($value)
+ {
+ return $value ? explode(',', $value) : [];
+ }
+
+ /**
+ * @param $value
+ * @return string
+ * @author xaboy
+ * @day 2020-05-09
+ */
+ public function setLabelIdAttr($value)
+ {
+ return implode(',', $value);
+ }
+
+ public function getAuthLabelAttr()
+ {
+ return app()->make(UserLabel::class)->whereIn('label_id', $this->label_id)->where('mer_id', $this->mer_id)->where('type', 1)->column('label_id');
+ }
+
+ /**
+ * @param $uid
+ * @param $mer_id
+ * @return bool
+ * @author xaboy
+ * @day 2020/10/20
+ */
+ public function isMerUser($uid, $mer_id)
+ {
+ return $this->existsWhere(compact('uid', 'mer_id'));
+ }
+
+ /**
+ * @param $uid
+ * @param $mer_id
+ * @return int
+ * @throws \think\db\exception\DbException
+ * @author xaboy
+ * @day 2020/10/20
+ */
+ public function updateLastTime($uid, $mer_id)
+ {
+ return UserMerchant::where(compact('uid', 'mer_id'))->update([
+ 'last_time' => date('Y-m-d H:i:s')
+ ]);
+ }
+
+ /**
+ * @param array $where
+ * @return mixed
+ * @author xaboy
+ * @day 2020/10/20
+ */
+ public function search(array $where)
+ {
+ return UserMerchant::alias('A')->leftJoin('User B', 'A.uid = B.uid')
+ ->when(isset($where['mer_id']) && $where['mer_id'] !== '',
+ function ($query) use ($where) {
+ $query->where('A.mer_id', $where['mer_id']);
+ }
+ )
+ ->when(isset($where['nickname']) && $where['nickname'], function (BaseQuery $query) use ($where) {
+ return $query->where('B.nickname', 'like', '%' . $where['nickname'] . '%');
+ })->when(isset($where['sex']) && $where['sex'] !== '', function (BaseQuery $query) use ($where) {
+ return $query->where('B.sex', intval($where['sex']));
+ })->when(isset($where['is_promoter']) && $where['is_promoter'] !== '', function (BaseQuery $query) use ($where) {
+ return $query->where('B.is_promoter', $where['is_promoter']);
+ })->when(isset($where['uids']), function (BaseQuery $query) use ($where) {
+ return $query->whereIn('A.uid', $where['uids']);
+ })->when(isset($where['user_time_type']) && $where['user_time_type'] !== '' && $where['user_time'] != '', function ($query) use ($where) {
+ if ($where['user_time_type'] == 'visit') {
+ getModelTime($query, $where['user_time'], 'A.last_time');
+ }
+ if ($where['user_time_type'] == 'add_time') {
+ getModelTime($query, $where['user_time'], 'A.create_time');
+ }
+ })->when(isset($where['pay_count']) && $where['pay_count'] !== '', function ($query) use ($where) {
+ if ($where['pay_count'] == -1) {
+ $query->where('A.pay_num', 0);
+ } else {
+ $query->where('A.pay_num', '>', $where['pay_count']);
+ }
+ })->when(isset($where['label_id']) && $where['label_id'] !== '', function (BaseQuery $query) use ($where) {
+ return $query->whereRaw('CONCAT(\',\',A.label_id,\',\') LIKE \'%,' . $where['label_id'] . ',%\'');
+ })->when(isset($where['user_type']) && $where['user_type'] !== '', function (BaseQuery $query) use ($where) {
+ return $query->where('B.user_type', $where['user_type']);
+ })->where('A.status', 1);
+ }
+
+ public function numUserIds($mer_id, $min, $max = null)
+ {
+ return UserMerchant::where('mer_id', $mer_id)->where('pay_num', '>=', $min)->when(!is_null($max), function ($query) use ($max) {
+ $query->where('pay_num', '<=', $max);
+ })->group('uid')->column('uid');
+ }
+
+ public function priceUserIds($mer_id, $min, $max = null)
+ {
+ return UserMerchant::where('mer_id', $mer_id)->where('pay_price', '>=', $min)->when(!is_null($max), function ($query) use ($max, $min) {
+ $query->where('pay_price', $min == $max ? '<=' : '<', $max);
+ })->group('uid')->column('uid');
+ }
+}
diff --git a/app/common/model/merchant/user/UserOrder.php b/app/common/model/merchant/user/UserOrder.php
new file mode 100644
index 0000000..f6b8c33
--- /dev/null
+++ b/app/common/model/merchant/user/UserOrder.php
@@ -0,0 +1,14 @@
+
+// +----------------------------------------------------------------------
+namespace app\validate\merchant;
+
+
+use think\Validate;
+
+class MerchantApplymentsValidate extends Validate
+{
+ protected $failException = true;
+
+ //2401:小微商户,指无营业执照的个人商家。
+ //2500:个人卖家,指无营业执照,已持续从事电子商务经营活动满6个月,且期间经营收入累计超过20万元的个人商家。(若选择该主体,请在“补充说明”填写相关描述)
+ //4:个体工商户,营业执照上的主体类型一般为个体户、个体工商户、个体经营。
+ //2:企业,营业执照上的主体类型一般为有限公司、有限责任公司。
+ //3:党政、机关及事业单位,包括国内各级、各类政府机构、事业单位等(如:公安、党 团、司法、交通、旅游、工商税务、市政、医疗、教育、学校等机构)。
+ //1708:其他组织,不属于企业、政府/事业单位的组织机构(如社会团体、民办非企业、基 金会),要求机构已办理组织机构代码证。
+
+ protected $rule = [
+ 'organization_type|主体类型' => 'require|in:2,3,4,2401,2500,1708',
+ 'business_license_info|营业执照/登记证书信息' => 'checkBusinessInfo',
+// 'organization_cert_info|组织机构代码证信息' => 'checkOrganization',
+ 'id_doc_type|证件类型' => 'require|in:1,2,3,4,5,6,7,8',
+ 'id_card_info|经营者/法人身份证信息' => 'checkIdCardInfo',
+ 'id_doc_info|经营者/法人身份证信息' => 'checkIdDocInfo',
+// 'need_account_info|是否填写结算银行账户' => 'require|in:true,false', 废弃字段
+ 'account_info|结算银行账户' => 'getAccountInfo',
+ 'contact_info|超级管理员信息' => 'getContactInfo',
+ 'sales_scene_info|店铺信息'=>'checkSalesSceneInfo',
+ 'merchant_shortname|商户简称' => 'require',
+ 'business_addition_desc' => 'checkBusinessAdditionDesc',
+ ];
+
+ /**
+ * TODO 营业执照/登记证书信息
+ * @param $item
+ * @param $rule
+ * @param $data
+ * @return bool|string
+ * @author Qinii
+ * @day 6/22/21
+ */
+ protected function checkBusinessInfo($item,$rule,$data)
+ {
+ if(!in_array($data['organization_type'],['2401','2500'])){
+ if(empty($item)) return '营业执照/登记证书信息为空';
+
+ if(!isset($item['business_license_copy']) || empty($item['business_license_copy'])) return '证件扫描件为空';
+ if(!isset($item['business_license_number']) || empty($item['business_license_number'])) return '证件注册号为空';
+ if(!isset($item['merchant_name']) || empty($item['merchant_name'])) return '商户名称为空';
+ if(!isset($item['legal_person']) || empty($item['legal_person'])) return '经营者/法定代表人姓名为空';
+
+ if(isset($item['business_time'])) {
+ $statr = $item['business_time'][0];
+ $end = $item['business_time'][1];
+ if ($end !== '长期') {
+ $statr = strtotime($statr);
+ $end = strtotime($end);
+ $t = $end - $statr;
+ if (($t / (3600 * 24)) <= 60) return '营业执照/登记证书有效期必须大于60天,即结束时间距当前时间需超过60天';
+ }
+ }
+
+ }
+ return true;
+ }
+
+ /**
+ * TODO 组织机构代码证信息
+ * @param $item
+ * @param $rule
+ * @param $data
+ * @return bool|string
+ * @author Qinii
+ * @day 6/22/21
+ */
+ protected function checkOrganization($item,$rule,$data)
+ {
+ $len = strlen($data['business_license_info']['business_license_number']);
+ if(!in_array($data['organization_type'],['4','2401','2500']) && $len === 18){
+ if(empty($item)) return '组织机构代码证信息为空';
+
+ if(!isset($item['organization_copy']) || empty($item['organization_copy'])) return '组织机构代码证照片为空';
+ if(!isset($item['organization_number']) || empty($item['organization_number'])) return '组织机构代码为空';
+ if(!isset($item['organization_time']) || empty($item['organization_time'])) return '组织机构代码有效期限为空';
+
+// list($statr,$end) = explode(',',$item['organization_time']);
+
+ $statr = $item['organization_time'][0];
+ $end = $item['organization_time'][1];
+
+ if($end !== '长期') {
+ $statr = strtotime($statr);
+ $end = strtotime($end);
+ $t = $end - $statr;
+ if(($t/(3600 * 24)) <= 60) return '组织机构代码证有效期必须大于60天,即结束时间距当前时间需超过60天';
+ }
+ }
+ return true;
+ }
+
+ /**
+ * TODO 经营者/法人身份证信息/身份证
+ * @param $item
+ * @param $rule
+ * @param $data
+ * @return bool|string
+ * @author Qinii
+ * @day 6/22/21
+ */
+ protected function checkIdCardInfo($item,$rule,$data)
+ {
+ if($data['id_doc_type'] == 1){
+ if(empty($item)) return '经营者/法人身份证信息为空';
+
+ if(!isset($item['id_card_copy']) || empty($item['id_card_copy'])) return '身份证人像面照片为空';
+ if(!isset($item['id_card_national']) || empty($item['id_card_national'])) return '身份证国徽面照片为空';
+ if(!isset($item['id_card_name']) || empty($item['id_card_name'])) return '身份证姓名为空';
+ if(!isset($item['id_card_number']) || empty($item['id_card_number'])) return '身份证号码为空';
+ if(!isset($item['id_card_valid_time_begin']) || empty($item['id_card_valid_time_begin'])) return '经营者/法人身份证信息身份证开始时间为空';
+ if(!isset($item['id_card_valid_time']) || empty($item['id_card_valid_time'])) return '经营者/法人身份证信息身份证有效期限为空';
+
+ if($item['id_card_valid_time'] !== '长期') {
+ $statr = time();
+ $end = strtotime($item['id_card_valid_time']);
+ $t = $end - $statr;
+ if(($t/(3600 * 24)) <= 60) return '经营者/法人身份证信息证件结束日期必须大于60天,即结束时间距当前时间需超过60天';
+ if(strtotime($item['id_card_valid_time_begin']) >= strtotime($item['id_card_valid_time'])) return '经营者/法人身份证信息证件结束日期必须大于证件开始时间';
+ }
+ if($data['organization_type'] === 2){
+ if(!isset($item['id_card_address']) || empty($item['id_card_address'])) return '经营者/法人身份证信息身份证居住地址为空';
+ }
+ };
+ return true;
+ }
+
+ /**
+ * TODO 经营者/法人身份证信息/通行证
+ * @param $item
+ * @param $rule
+ * @param $data
+ * @return bool|string
+ * @author Qinii
+ * @day 6/22/21
+ */
+ protected function checkIdDocInfo($item,$rule,$data)
+ {
+ if(in_array($data['organization_type'],['2401','2500']) && !empty($item)) return '小微/个人卖家可选证件类型:身份证';
+
+ if($data['id_doc_type'] !== 1){
+ if(empty($item)) return '经营者/法人身份证信息为空';
+
+ if(!isset($item['id_doc_name']) || empty($item['id_doc_name'])) return '证件姓名为空';
+ if(!isset($item['id_doc_number']) || empty($item['id_doc_number'])) return '证件号码为空';
+ if(!isset($item['id_doc_copy']) || empty($item['id_doc_copy'])) return '经营者/法人其他类型证件信息证件正面照片为空';
+ if($data['id_doc_type'] !== 2) //护照不需要传反面
+ {
+ if(!isset($item['id_doc_copy_back']) || empty($item['id_doc_copy_back'])) return '经营者/法人其他类型证件信息证件反面照片为空';
+ }
+ if(!isset($item['doc_period_begin']) || empty($item['doc_period_begin'])) return '经营者/法人其他类型证件信息证件有效期开始时间为空';
+ if(!isset($item['doc_period_end']) || empty($item['doc_period_end'])) return '经营者/法人其他类型证件信息证件结束日期为空';
+
+ if($item['doc_period_end'] !== '长期') {
+ $statr = time();
+ $end = strtotime($item['doc_period_end']);
+ $t = $end - $statr;
+ if(($t/(3600 * 24)) <= 60) return '经营者/法人其他类型证件信息证件结束日期必须大于60天,即结束时间距当前时间需超过60天';
+ if(strtotime($item['doc_period_begin']) >= strtotime($item['doc_period_end'])) return '经营者/法人其他类型证件信息证件结束日期必须大于证件开始时间';
+ if($data['organization_type'] === 2){
+ if(!isset($item['id_doc_address']) || empty($item['id_doc_address'])) return '经营者/法人其他类型证件信息证件居住地址为空';
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * TODO 结算银行账户
+ * @param $item
+ * @param $rule
+ * @param $data
+ * @return bool|string
+ * @author Qinii
+ * @day 6/22/21
+ */
+ protected function getAccountInfo($item,$rule,$data)
+ {
+// if($data['need_account_info']){
+
+ if(empty($item)) return '结算银行账户信息为空';
+
+ if(!isset($item['bank_account_type']) || empty($item['bank_account_type'])) return '账户类型为空';
+ if(!isset($item['account_bank']) || empty($item['account_bank'])) return '开户银行为空';
+ if(!isset($item['account_name']) || empty($item['account_name'])) return '开户名称为空';
+ if(!isset($item['bank_address_code']) || empty($item['bank_address_code'])) return '开户银行省市编码为空';
+ if(!isset($item['account_number']) || empty($item['account_number'])) return '银行帐号为空';
+
+// }
+
+ return true;
+ }
+
+ /**
+ * TODO 超级管理员信息
+ * @param $item
+ * @param $rule
+ * @param $data
+ * @return bool|string
+ * @author Qinii
+ * @day 6/22/21
+ */
+ protected function getContactInfo($item,$rule,$data)
+ {
+
+ if(empty($item)) return '超级管理员信息信息为空';
+
+ if(!isset($item['contact_type']) || empty($item['contact_type'])) return '超级管理员类型为空';
+ if(!isset($item['contact_name']) || empty($item['contact_name'])) return '超级管理员姓名为空';
+ if(!isset($item['contact_id_card_number']) || empty($item['contact_id_card_number'])) return '超级管理员身份证件号码为空';
+ if(!isset($item['mobile_phone']) || empty($item['mobile_phone'])) return '超级管理员手机为空';
+
+ if(!in_array($data['organization_type'],['2401','2500'])){
+ if(!isset($item['contact_email']) || empty($item['contact_email'])) return '邮箱为空';
+ }
+
+ if($item['contact_type'] === 66) //当超级管理员类型为66(经办人时)
+ {
+ if(!isset($item['contact_id_doc_type']) || empty($item['contact_id_doc_type']) || !in_array($item['contact_id_doc_type'],[1,2,3,4,5,6,7,8])) return '超级管理员证件类型为空或不合法';
+ if(!isset($item['contact_id_doc_copy']) || empty($item['contact_id_doc_copy'])) return '超级管理员信息证件正面照片为空';
+ if($item['contact_id_doc_type'] !== 2) //护照不需要传反面
+ {
+ if(!isset($item['contact_id_doc_copy_back']) || empty($item['contact_id_doc_copy_back'])) return '超级管理员信息证件反面照片为空';
+ }
+ if(!isset($item['contact_id_doc_period_begin']) || empty($item['contact_id_doc_period_begin'])) return '超级管理员信息证件有效期开始时间为空';
+ if(!isset($item['contact_id_doc_period_end']) || empty($item['contact_id_doc_period_end'])) return '超级管理员信息证件结束日期为空';
+
+ if($item['contact_id_doc_period_end'] !== '长期') {
+ $statr = time();
+ $end = strtotime($item['contact_id_doc_period_end']);
+ $t = $end - $statr;
+ if(($t/(3600 * 24)) <= 60) return '超级管理员信息证件结束日期必须大于60天,即结束时间距当前时间需超过60天';
+ if(strtotime($item['contact_id_doc_period_begin']) >= strtotime($item['contact_id_doc_period_end'])) return '超级管理员信息证件结束日期必须大于证件开始时间';
+ }
+ if(!isset($item['business_authorization_letter']) || empty($item['business_authorization_letter'])) return '超级管理员信息业务办理授权函为空';
+ }
+
+ return true;
+ }
+
+ /**
+ * TODO 店铺信息
+ * @param $item
+ * @param $rule
+ * @param $data
+ * @return bool|string
+ * @author Qinii
+ * @day 6/22/21
+ */
+ protected function checkSalesSceneInfo($item,$rule,$data)
+ {
+ if(empty($item)) return '店铺信息为空';
+
+ if(!isset($item['store_name']) || empty($item['store_name'])) return '店铺名称为空';
+
+ if(!isset($item['store_url']) && !isset($item['store_url'])) return '店铺链接和店铺二维码二选一';
+
+ return true;
+ }
+
+ /**
+ * TODO 补充说明s
+ * @param $item
+ * @param $rule
+ * @param $data
+ * @return bool|string
+ * @author Qinii
+ * @day 6/24/21
+ */
+ protected function checkBusinessAdditionDesc($item,$rule,$data)
+ {
+ if($data['organization_type'] == 2500 && empty($item)) return '若主体为“个人卖家”:补充说明不能为空';
+ return true;
+ }
+
+}
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..86aeca2
--- /dev/null
+++ b/index.html
@@ -0,0 +1,39 @@
+
+
+
+
+
恭喜,站点创建成功!
+
+
+
+
+
恭喜, 站点创建成功!
+
这是默认index.html,本页面由系统自动生成
+
+ 本页面在FTP根目录下的index.html
+ 您可以修改、删除或覆盖本页面
+ FTP相关信息,请到“面板系统后台 > FTP” 查看
+
+
+
+
\ No newline at end of file
diff --git a/route/app.php b/route/app.php
index d8e09e3..c7b4229 100644
--- a/route/app.php
+++ b/route/app.php
@@ -14,4 +14,4 @@ Route::get('think', function () {
return 'hello,ThinkPHP6!';
});
-Route::get('hello/:name', 'index/hello');
+Route::get('hello/:name', 'index/hello');
\ No newline at end of file