diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..e98f03d
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,32 @@
+The Yii framework is free software. It is released under the terms of
+the following BSD License.
+
+Copyright © 2008 by Yii Software LLC (http://www.yiisoft.com)
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ * Neither the name of Yii Software LLC nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/MP_verify_AHdn4Rhtts2iuS68.txt b/MP_verify_AHdn4Rhtts2iuS68.txt
new file mode 100644
index 0000000..15c44ef
--- /dev/null
+++ b/MP_verify_AHdn4Rhtts2iuS68.txt
@@ -0,0 +1 @@
+AHdn4Rhtts2iuS68
\ No newline at end of file
diff --git a/MP_verify_VD3pWrda5YjvBMkl.txt b/MP_verify_VD3pWrda5YjvBMkl.txt
new file mode 100644
index 0000000..dcceba9
--- /dev/null
+++ b/MP_verify_VD3pWrda5YjvBMkl.txt
@@ -0,0 +1 @@
+VD3pWrda5YjvBMkl
\ No newline at end of file
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644
index 0000000..4181f83
--- /dev/null
+++ b/Vagrantfile
@@ -0,0 +1,72 @@
+require 'yaml'
+require 'fileutils'
+
+domains = {
+ frontend: 'y2aa-frontend.dev',
+ backend: 'y2aa-backend.dev'
+}
+
+config = {
+ local: './vagrant/config/vagrant-local.yml',
+ example: './vagrant/config/vagrant-local.example.yml'
+}
+
+# copy config from example if local config not exists
+FileUtils.cp config[:example], config[:local] unless File.exist?(config[:local])
+# read config
+options = YAML.load_file config[:local]
+
+# check github token
+if options['github_token'].nil? || options['github_token'].to_s.length != 40
+ puts "You must place REAL GitHub token into configuration:\n/yii2-app-advanced/vagrant/config/vagrant-local.yml"
+ exit
+end
+
+# vagrant configurate
+Vagrant.configure(2) do |config|
+ # select the box
+ config.vm.box = 'ubuntu/trusty64'
+
+ # should we ask about box updates?
+ config.vm.box_check_update = options['box_check_update']
+
+ config.vm.provider 'virtualbox' do |vb|
+ # machine cpus count
+ vb.cpus = options['cpus']
+ # machine memory size
+ vb.memory = options['memory']
+ # machine name (for VirtualBox UI)
+ vb.name = options['machine_name']
+ end
+
+ # machine name (for vagrant console)
+ config.vm.define options['machine_name']
+
+ # machine name (for guest machine console)
+ config.vm.hostname = options['machine_name']
+
+ # network settings
+ config.vm.network 'private_network', ip: options['ip']
+
+ # sync: folder 'yii2-app-advanced' (host machine) -> folder '/app' (guest machine)
+ config.vm.synced_folder './', '/app', owner: 'vagrant', group: 'vagrant'
+
+ # disable folder '/vagrant' (guest machine)
+ config.vm.synced_folder '.', '/vagrant', disabled: true
+
+ # hosts settings (host machine)
+ config.vm.provision :hostmanager
+ config.hostmanager.enabled = true
+ config.hostmanager.manage_host = true
+ config.hostmanager.ignore_private_ip = false
+ config.hostmanager.include_offline = true
+ config.hostmanager.aliases = domains.values
+
+ # provisioners
+ config.vm.provision 'shell', path: './vagrant/provision/once-as-root.sh', args: [options['timezone']]
+ config.vm.provision 'shell', path: './vagrant/provision/once-as-vagrant.sh', args: [options['github_token']], privileged: false
+ config.vm.provision 'shell', path: './vagrant/provision/always-as-root.sh', run: 'always'
+
+ # post-install message (vagrant console)
+ config.vm.post_up_message = "Frontend URL: http://#{domains[:frontend]}\nBackend URL: http://#{domains[:backend]}"
+end
diff --git a/_.zhizhuchuxing.cn.key b/_.zhizhuchuxing.cn.key
new file mode 100644
index 0000000..b1488f8
--- /dev/null
+++ b/_.zhizhuchuxing.cn.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEogIBAAKCAQEArwuahgHV/vnx5tMyIo+qNZul/DiWtXouicY6fcfuF9y6SIcu
+A5hYfAnyAU3dACK44SGWrScv4OaB5fGQOtkomb8cK5Ibc7p9312Tag04+RMqHrl0
+GroLn7qqRodrPulrkmTDrO9xymEhS2RMYSENoDMaBSiXlfnYQQOU9//UTlDAgB/O
+1ZqB7VyuYh3pUUtYN2M/E+7d4VDTpFevD9gEDLPRiWpIOoudw/cAFXX+l5f5R8tQ
+lFmy8QY+M0+NqbkZ03FsiNCNXhN5ldUGKCmxA89lGhV9m5/ABTbPjuAjOOv934sP
+pV73pNUPIG15r5e5tyPzITNeA/SYQHkaP+++bwIDAQABAoIBAFE741Q5WeRgfkCO
+1n9viKAkQZ2RbW9+6kYJ9m8U74unZdPu2A3XD4lQ3Dx6tAsyEfZ4rgJhYzjOAI6D
+0lldGhhvtlUKEy9b5rpYJOdch4ofuLZVfmpA2NAhwo/EnKKvlLp1hNGmtXokJV1l
+iISy4C3uSS8HrYFuV0ukq+eDlDVbQ6m580aGbkz3h2lHWQ9hAI7Zo6Ff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Y-----
\ No newline at end of file
diff --git a/_.zhizhuchuxing.cn_bundle.crt b/_.zhizhuchuxing.cn_bundle.crt
new file mode 100644
index 0000000..972aa3a
--- /dev/null
+++ b/_.zhizhuchuxing.cn_bundle.crt
@@ -0,0 +1,90 @@
+-----BEGIN CERTIFICATE-----
+MIIFhzCCBG+gAwIBAgIQLIW51UR3rinQBHTR5BuY3DANBgkqhkiG9w0BAQsFADBE
+MQswCQYDVQQGEwJDTjEaMBgGA1UECgwRV29TaWduIENBIExpbWl0ZWQxGTAXBgNV
+BAMMEFdvU2lnbiBEViBTU0wgQ0EwHhcNMTcxMjExMDkzMTQ5WhcNMTgxMjExMDkz
+MTQ5WjAqMQswCQYDVQQGEwJDTjEbMBkGA1UEAwwSKi56aGl6aHVjaHV4aW5nLmNu
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArwuahgHV/vnx5tMyIo+q
+NZul/DiWtXouicY6fcfuF9y6SIcuA5hYfAnyAU3dACK44SGWrScv4OaB5fGQOtko
+mb8cK5Ibc7p9312Tag04+RMqHrl0GroLn7qqRodrPulrkmTDrO9xymEhS2RMYSEN
+oDMaBSiXlfnYQQOU9//UTlDAgB/O1ZqB7VyuYh3pUUtYN2M/E+7d4VDTpFevD9gE
+DLPRiWpIOoudw/cAFXX+l5f5R8tQlFmy8QY+M0+NqbkZ03FsiNCNXhN5ldUGKCmx
+A89lGhV9m5/ABTbPjuAjOOv934sPpV73pNUPIG15r5e5tyPzITNeA/SYQHkaP+++
+bwIDAQABo4ICjTCCAokwDAYDVR0TAQH/BAIwADA8BgNVHR8ENTAzMDGgL6Athito
+dHRwOi8vd29zaWduLmNybC5jZXJ0dW0ucGwvd29zaWduLWR2Y2EuY3JsMHcGCCsG
+AQUFBwEBBGswaTAuBggrBgEFBQcwAYYiaHR0cDovL3dvc2lnbi1kdmNhLm9jc3At
+Y2VydHVtLmNvbTA3BggrBgEFBQcwAoYraHR0cDovL3JlcG9zaXRvcnkuY2VydH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peUQl4E7Sztapx6lX0FKgV/CF1mrWHUdqx1lpdzY70a
+QVkppV4ig8OLWfqaova9ML9yHRyZhpzyhTwd9yaWLy75ArG1qVDoOPqbCl60BMDO
+TjksygtbYvBNWFA0meaaLNKQ1wmB1sCqXs7+0vehukvZ1oaOGR+mBkdCcuBWCgAc
+eLmNzJkEN0k=
+-----END CERTIFICATE-----
diff --git a/codeception.yml b/codeception.yml
new file mode 100644
index 0000000..af20104
--- /dev/null
+++ b/codeception.yml
@@ -0,0 +1,9 @@
+# global codeception file to run tests from all apps
+include:
+ - common
+ - frontend
+ - backend
+paths:
+ log: console/runtime/logs
+settings:
+ colors: true
\ No newline at end of file
diff --git a/common/Controller/AdminController.php b/common/Controller/AdminController.php
new file mode 100644
index 0000000..2cff568
--- /dev/null
+++ b/common/Controller/AdminController.php
@@ -0,0 +1,99 @@
+request->get($key, $val);
+ }
+
+ /**
+ * Des:获取post传值的参数
+ * Name: _get
+ * @param $key
+ * @param $val
+ * @return array|mixed
+ * @author 倪宗锋
+ */
+ public function _post($key, $val = '')
+ {
+ return trim(Yii::$app->request->post($key, $val));
+ }
+
+ /**
+ * Des:获取所有传参的参数值
+ * Name: _request
+ * @param $key
+ * @param $val
+ * @return mixed
+ * @author 倪宗锋
+ */
+ public function _request($key, $val = '')
+ {
+ return trim(Yii::$app->request->getQueryParam($key, $val));
+ }
+
+ /**
+ * Des:访问方法前的参数
+ * Name: beforeaction
+ * @param \yii\base\Action $action
+ * @return bool
+ * @author 倪宗锋
+ */
+ public function beforeaction($action)
+ {
+ /**获取路由地址**/
+ $actionName = $action->controller->id . '/' . $action->id;
+ $unLoginConfig = AdminUtil::getUnLoginConfig();
+
+ if (in_array($actionName, $unLoginConfig) == false) {
+ //校验用户登录信息
+ $checkLogin = AdminUtil::checkLogin();
+ if ($checkLogin['flag'] == false) {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ Yii::$app->response->data = $checkLogin;
+ return false;
+ }
+
+ //校验用户权限
+ $authAction = AdminUtil::checkAuthAction($actionName);
+ if($authAction['flag'] == false) {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ Yii::$app->response->data = $authAction;
+ return false;
+ }
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/common/Controller/FxWebController.php b/common/Controller/FxWebController.php
new file mode 100644
index 0000000..739a274
--- /dev/null
+++ b/common/Controller/FxWebController.php
@@ -0,0 +1,95 @@
+request->get($key, $val);
+ }
+
+ /**
+ * Des:获取post传值的参数
+ * Name: _get
+ * @param $key
+ * @param $val
+ * @return array|mixed
+ * @author 倪宗锋
+ */
+ public function _post($key, $val = '')
+ {
+ return Yii::$app->request->post($key, $val);
+ }
+
+ /**
+ * Des:获取所有传参的参数值
+ * Name: _request
+ * @param $key
+ * @param $val
+ * @return mixed
+ * @author 倪宗锋
+ */
+ public function _request($key, $val = '')
+ {
+ return Yii::$app->request->getQueryParam($key, $val);
+ }
+
+ /**
+ * Des:访问方法前的参数
+ * Name: beforeaction
+ * @param \yii\base\Action $action
+ * @return bool
+ * @author 倪宗锋
+ */
+ public function beforeaction($action)
+ {
+ /**获取路由地址**/
+ $actionName = $action->controller->id . '/' . $action->id;
+ $unLoginConfig = FxUtil::getUnLoginConfig();
+ $unCheckPhone = require APP_PATH.'/config/unCheckPhone.php';
+ //获取非强制登录接口配置信息
+ $checkPhone = true;
+ if(in_array($actionName, $unCheckPhone)) {
+ $checkPhone = false;
+ }
+ if (in_array($actionName, $unLoginConfig) == false) {
+ $checkLogin = FxUtil::checkLogin($checkPhone);
+ if ($checkLogin['flag'] == false) {
+ Yii::$app->response->format = 'json';
+ Yii::$app->response->data = $checkLogin;
+ return false;
+ }
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/common/Controller/ShopWebController.php b/common/Controller/ShopWebController.php
new file mode 100644
index 0000000..91f3c0c
--- /dev/null
+++ b/common/Controller/ShopWebController.php
@@ -0,0 +1,66 @@
+request->get($key, $val);
+ }
+
+ /**
+ * Des:获取post传值的参数
+ * Name: _get
+ * @param $key
+ * @param $val
+ * @return array|mixed
+ * @author 倪宗锋
+ */
+ public function _post($key, $val = '')
+ {
+ return Yii::$app->request->post($key, $val);
+ }
+
+ /**
+ * Des:获取所有传参的参数值
+ * Name: _request
+ * @param $key
+ * @param $val
+ * @return mixed
+ * @author 倪宗锋
+ */
+ public function _request($key, $val = '')
+ {
+ return Yii::$app->request->getQueryParam($key, $val);
+ }
+}
\ No newline at end of file
diff --git a/common/config/.gitignore b/common/config/.gitignore
new file mode 100644
index 0000000..42799dd
--- /dev/null
+++ b/common/config/.gitignore
@@ -0,0 +1,3 @@
+main-local.php
+params-local.php
+test-local.php
diff --git a/common/config/aliConfig/payConfig.php b/common/config/aliConfig/payConfig.php
new file mode 100644
index 0000000..4892507
--- /dev/null
+++ b/common/config/aliConfig/payConfig.php
@@ -0,0 +1,52 @@
+ [
+ 'app_id' => "2016102100728544",//应用ID,您的APPID。
+ //商户私钥,您的原始格式RSA私钥
+ 'merchant_private_key' => "MIICXQIBAAKBgQC3Vh2FJi4Yfm7/MrohS3lPyL/jVEMlobvhmekohNid4cQPxzQg4PGFoOqitEcVDjJkDgd3Hs1K12g6cUnNBM0A5FLY46t3UJ5pnV1FxCMTst1vGGElzgnw7jNO/68AL/PUKpqE7kVYHOpBTwX2Ml0hauX/pRUOjTIPGS0VNvSIqwIDAQABAoGAfeNS59+8nTML8o4Zgs05YpB9OpLcfJWe1h2CHUGDIH4qy47Ee6MaFODW3JwfhxS1g0Ci3ae33aElv6OUwoN+Y+nJ0Gi83iV+wA6VOkF2lw9mj6YzAYgSrSSQj2MFm0zXd2IFMhm8cHIQs/IaA5ajUaHz+oPvsedaCEpMlayhHeECQQDdyfXjPTnY0nIKokvswpJj4P9sZpZh1ANOjpZ/pXrIhQm1IV9m9YjIvr1lcLcdSX/oFc9DWUu9nKbJqsmgc4UxAkEA0528I3uzTBcvuxFZbm0F6eSrFLX47RDNWB1YcqD6FWzGl+vMFxkMf0dQ8qsNntp1EZ7WGI1QKjwCtozcBMgkmwJACXcuHFWnm15X6aZFkUQ4lTSsEgdK0cAHqBmjyKzaUaaD5IwZEz7VaKPjV2n5FrHlWJVdtCUie2QtJhw44LUtcQJBAIt2PcKIyI5SDZPUiELdOPN/TzyT/NyHoTz8Aglxi79I88y1isiCKplLL87t6kkRoeud6W0+3GEpMYSLaokAOhcCQQCaMtuM7IMmlOtC6EIRniQzZjGsLhMTRqYtFD3mA3GiIcuShv5+i/qbrFRApJu70TQqPEnIjsqVxwCKVNmROU/8",
+ 'return_url' => "http://alipay/return_url.php", //同步跳转
+ 'charset' => "UTF-8",//编码格式
+ 'timeout' => '2m',//未支付超时时间
+ 'gatewayUrl' => "http://openapi.alipay.com/gateway.do",//支付宝网关
+ //支付宝公钥
+ 'alipay_public_key' => "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIgHnOn7LLILlKETd6BFRJ0GqgS2Y3mn1wMQmyh9zEyWlz5p1zrahRahbXAfCfSqshSNfqOmAQzSHRVjCqjsAw1jyqrXaPdKBmr90DIpIxmIyKXv4GGAkPyJ/6FTFY99uhpiq0qadD/uSzQsefWo0aTvP/65zi3eof7TcZ32oWpwIDAQAB"
+ ],
+ //蜘蛛分销支付宝
+ '2017030306030595' => [
+ 'app_id' => "2017030306030595",//应用ID,您的APPID。
+ //商户私钥,您的原始格式RSA私钥
+ 'merchant_private_key' => "MIICXgIBAAKBgQDvgdcxY04CAINcdWsDcs5HE0qhaj7PtfOvtlDktihVuguXstQaz29c7nuMPrpabS24q7s0EPCIql3qE/JWHQ3wAy0+rmvrJyS1SygYeiVhWX0QfJEmsVcg5HBXd+cmHanYAjfQrOAg3hw43JWgtogC6EwJPdiBRq1G4hUF9iXQJQIDAQABAoGBAIUXP7+gET8njdeZIAhgiaQRYk1kPtcpouqngzg0ySEqKzr3Esp7LsUTePAsA14wgVG3jGWYbDFlip6Cyw1zQ8RirMv8VpzmH1Y8crqAJhxXcapJxW4ZawI+WVvLfQtsAs+BYKZ3gUejqkFVFDsD8t0TdJ69atYk5LolQfizxKcBAkEA99Ag9MJwKVk6noVSJI1Abyq0c0nsAXDMMW210VdusKhfij9wYwTqEtHE2G0HLRab6AdLUVPDW6FvyG6Kx1rVxQJBAPdrdzd8V6fvWu5BonMdIxyVIKQZBK47pKSlEWKtwRAWmskIgLxMVq/yZQ/qO8MguYZoS7HE3jMQdVWKbw09FuECQQDD4Y0bS1JTLMfMI8ARSmHDPXNTqfvWC64r5/eO2NiS5RRX99tDOdA4Pf2lwVCp0DQ+TP249Ef4dvwf51jlSaStAkAm/qf+dbl2/VFuhaetzuTOx24qjsrfDwVm8aEo1Uu9VmK01oM7qihreJ+W/4rFuS2kUmHDtcxzbd+gSL4x7vPhAkEA8/YHEIto1jBJiOUzBObPrPkzypgaOJAUS8fM1GmulRLxAdfujsdZdKmAmq+d421ONeL/D4HMKGzxTVwYXi2H+Q==",
+ 'return_url' => "http://alipay/return_url.php", //同步跳转
+ 'charset' => "UTF-8",//编码格式
+ 'timeout' => '2m',//未支付超时时间
+ 'gatewayUrl' => "http://openapi.alipay.com/gateway.do",//支付宝网关
+ //支付宝公钥
+ 'alipay_public_key' => 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDvgdcxY04CAINcdWsDcs5HE0qhaj7PtfOvtlDktihVuguXstQaz29c7nuMPrpabS24q7s0EPCIql3qE/JWHQ3wAy0+rmvrJyS1SygYeiVhWX0QfJEmsVcg5HBXd+cmHanYAjfQrOAg3hw43JWgtogC6EwJPdiBRq1G4hUF9iXQJQIDAQAB'
+ ],
+ //千岛湖支付宝
+ '2017032106317613' => [
+ 'app_id' => "2017032106317613",//应用ID,您的APPID。
+ //商户私钥,您的原始格式RSA私钥
+ 'merchant_private_key' => "MIICXAIBAAKBgQDfCHWdhKOcaTWM9WDanO/3Txy00r6yzkrl9qcE9Z1NhC5HpfEvvT5leUv+7ekpNJfFIj4/N8Z3wjVeE/ydxmmeVYJZOG25rLyLrRZJH1SI6nAISkD05cMa/hiXGgojJkkKhNGt+yH2XfjZl/m5k/Xs5yk123EkVJ0nbzODwJ8o2wIDAQABAoGBAL0CG0JxLIIZuvMI45qAUvAfkDFBQ7CeGGUIAQS37SXK9blsTJfrZVxzTc7t6aEs282JNn02lC/bWoSupW9DvS6G4S48bKzcIFGnIkI48Yj2nmguWUy70cM73QjmLnCHTh9+5CJtsT5kmU3+wKhIypQ2A2jHBEWXr2ltjpnSmjIpAkEA+ZDeVCsqGgB8OzMWYroc7yzwzOx3T4OCjj4tdTmSf6KWtx9UVMZTdDauSaxkanhLsF3wlAQG7xGq8Zwyn4MpvwJBAOTIeXp3UFVfsbFXLXegA25UKnHG2BnCwnGhk1kyRXITyaFF8zicO1PP9Sn1chC9MWgGHWa/J33LdZJyyAEPb+UCQGwKf3XIyg0/sIigcUyEbgpNVmIg7PYLZPXXjS52oimHZeAZPBUHVxG0qndSnpZJRdswj/pEVAwjhfHbQT81NVkCQGfH7Rs5vo5Lz45zzmNCievlcC+WlPbym0PymKXQoSIDieaHlbJrZJo7bqou9iRTvnLCu1mdguuUfOwG92VLvGUCQCFyXsmKMswsxkB8LEuE452UpaLxtQJWki3axgG7FvssF7V7aYr+GwgPXRH6lcHSJqPeAlxdwC2bG1FxTTeJFds=",
+ 'return_url' => "http://alipay/return_url.php", //同步跳转
+ 'charset' => "UTF-8",//编码格式
+ 'timeout' => '2m',//未支付超时时间
+ 'gatewayUrl' => "http://openapi.alipay.com/gateway.do",//支付宝网关
+ //支付宝公钥
+ 'alipay_public_key' => 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB'
+ ]
+];
\ No newline at end of file
diff --git a/common/config/bootstrap.php b/common/config/bootstrap.php
new file mode 100644
index 0000000..bf0be97
--- /dev/null
+++ b/common/config/bootstrap.php
@@ -0,0 +1,3 @@
+ "/^[a-zA-Z0-9_+\\.\\-]{2,}\@(([0-9a-zA-Z\\-]+)[.])+[a-zA-Z]{2,4}$/",//邮箱
+ 'mobile' => "/^[1][0-9]{10}$/",//手机号码
+ 'codeMsg' => "/^[a-zA-z0-9]{4}$/",//图形验证码和邮箱验证码
+ 'memo' => "/^[A-Za-z0-9_\x{4e00}-\x{9fa5}]{1,20}$/u",//备注
+ 'intVal' => "/^[1-9][0-9]{0,10}$/",//数据库验证id
+ 'id_card'=>"/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{4}$/", //身份证验证
+ 'date'=> "/^[0-9]{4}-(((0[13578]|(10|12))-(0[1-9]|[1-2][0-9]|3[0-1]))|(02-(0[1-9]|[1-2][0-9]))|((0[469]|11)-(0[1-9]|[1-2][0-9]|30)))$/", //验证年-月-日
+ 'fx_user_name' => "/^[A-Za-z0-9_\x{4e00}-\x{9fa5}]{1,100}$/u",//备注
+ 'money' => '/^\+?(?!0+(\.00?)?$)\d+(\.\d\d?)?$/',//金额正则
+);
\ No newline at end of file
diff --git a/common/config/main.php b/common/config/main.php
new file mode 100644
index 0000000..7b5ddc2
--- /dev/null
+++ b/common/config/main.php
@@ -0,0 +1,7 @@
+ 'utf-8',
+ 'language' => 'zh-CN',
+ 'timeZone' => 'Asia/Shanghai',
+ 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
+];
diff --git a/common/config/params.php b/common/config/params.php
new file mode 100644
index 0000000..f8ce702
--- /dev/null
+++ b/common/config/params.php
@@ -0,0 +1,7 @@
+ 'admin@example.com',
+ 'supportEmail' => 'support@example.com',
+ 'user.passwordResetTokenExpire' => 3600,
+ 'system' => 1
+];
diff --git a/common/config/siteConfig.php b/common/config/siteConfig.php
new file mode 100644
index 0000000..aa1c777
--- /dev/null
+++ b/common/config/siteConfig.php
@@ -0,0 +1,25 @@
+ '/fx/?r=weChat/we-chat/set-login',//FX 本站点的第三方授权接收地址
+ 'fx_authLoginRedirectUrl' => '/fx/?r=weChat/we-chat/auth-login',//fx 本站点的第三方授权中间跳转地址
+ 'shop_authLoginUrl' => '/shop/?r=weChat/we-chat/set-login',//shop 本站点的第三方授权接收地址
+ 'shop_authLoginRedirectUrl' => '/shop/?r=weChat/we-chat/auth-login',//shop 本站点的第三方授权中间跳转地址
+ 'authorizeUrl' => 'https://open.weixin.qq.com/connect/oauth2/authorize?',//微信提供的授权登录路径
+ 'authTokenUrl' => 'https://api.weixin.qq.com/sns/oauth2/access_token?',//微信token获取地址
+ 'bind_fx_user' => [34, 264, 1, 258, 263, 267, 460, 736, 671, 658, 486, 596],
+ "wx_home"=>'/web/zzcx/index.html#/main/home'//微信首页地址
+];
diff --git a/common/config/siteConfig/dev/siteConfig.php b/common/config/siteConfig/dev/siteConfig.php
new file mode 100644
index 0000000..b818ded
--- /dev/null
+++ b/common/config/siteConfig/dev/siteConfig.php
@@ -0,0 +1,37 @@
+'小黑鱼出行',//网站头
+ 'entryAuthWeChat' => 'wx34e2f2b38cfb15a1',//授权登录微信APPID
+ 'aliPay' => '2017030306030595',//阿里支付
+ 'weChatAuthLoginUrl' => 'http://fx.zhizhuchuxing.com/fx/?r=weChat/we-chat/login-redirect',//第三方提供的微信授权登录路径
+ 'host_name'=> 'http://fx.zhizhuchuxing.cn',//网站域名
+ 'notify_url' => 'http://nwx.zhizhuchuxing.cn/zzcx/order/order/notify',//支付回调地址
+ 'adm_host' => 'http://sandbox.zhizhuchuxing.cn',//管理后台地址
+ 'adm_host1' => 'http://sandbox1.zhizhuchuxing.cn',//管理后台1地址
+ 'adm_user' => 'newfx',//cs接口使用 用户名
+ 'adm_user_key' => 'newfx_key',//cs接口使用 用户秘钥
+ 'adm_user_id' => 581,//cs接口使用 用户ID
+ 'adm_source_id' => '1285',//渠道来源编号
+ 'show_recom' => [25],//LBS定位的菜单栏ID
+ 'kefu_tel' => '021-33280519',//客服电话
+ 'YunYinPhone' => '13795379620',//运营通知电话
+ 'recharge_amount' => 1,//分销商户充值最低金额
+ 'pc_uid' => '',//分销PC端展示用户ID
+ 'zzcx_host' => 'http://nwx.zhizhuchuxing.cn',//下单
+ 'wxWeChat' => 'wxbe6da4af3e529e0c',//微信公众号的APPID
+ 'wx_get_token'=> 'http://wx.zhizhuchuxing.com',
+ "apply_commission_min"=>50,//最低可提取佣金
+];
\ No newline at end of file
diff --git a/common/config/siteConfig/hzdev/siteConfig.php b/common/config/siteConfig/hzdev/siteConfig.php
new file mode 100644
index 0000000..11fa606
--- /dev/null
+++ b/common/config/siteConfig/hzdev/siteConfig.php
@@ -0,0 +1,37 @@
+ '昆山集散中心',//网站头
+ 'entryAuthWeChat' => 'wx81ac156a5c166881',//授权登录微信APPID
+ 'aliPay' => '',//阿里支付
+ 'weChatAuthLoginUrl' => 'http://hz.zhizhuchuxing.com/zzcx/user/login/auth-login?_a='. microtime(true),//第三方提供的微信授权登录路径
+ 'host_name' => 'http://hz.zhizhuchuxing.cn',//网站域名
+ 'notify_url' => 'http://hz.zhizhuchuxing.cn/zzcx/order/order/notify',//支付回调地址
+ 'adm_host' => 'http://sandbox.zhizhuchuxing.cn',//管理后台地址
+ 'adm_host1' => 'http://sandbox1.zhizhuchuxing.cn',//管理后台1地址
+ 'adm_user' => 'admin_034',//cs接口使用 用户名
+ 'adm_user_key' => 'admin_034',//cs接口使用 用户秘钥
+ 'adm_user_id' => 772,//cs接口使用 用户ID
+ 'adm_source_id' => '1660',//渠道来源编号
+ 'show_recom' => [25],//LBS定位的菜单栏ID
+ 'kefu_tel' => '021-33280519',//客服电话
+ 'YunYinPhone' => '18874559393',//运营通知电话
+ 'recharge_amount' => 1,//分销商户充值最低金额
+ 'pc_uid' => '',//分销PC端展示用户ID
+ 'zzcx_host' => 'http://hz.zhizhuchuxing.cn',//下单
+ 'wxWeChat' => 'wx81ac156a5c166881',//微信公众号的APPID
+ 'wx_get_token'=> 'http://wx.zhizhuchuxing.com',
+ "apply_commission_min"=>50,//最低可提取佣金
+];
\ No newline at end of file
diff --git a/common/config/siteConfig/hzpro/siteConfig.php b/common/config/siteConfig/hzpro/siteConfig.php
new file mode 100644
index 0000000..bb4b8ea
--- /dev/null
+++ b/common/config/siteConfig/hzpro/siteConfig.php
@@ -0,0 +1,37 @@
+ '昆山集散中心',//网站头
+ 'entryAuthWeChat' => 'wx0376620fe134cef0',//授权登录微信APPID
+ 'aliPay' => '',//阿里支付
+ 'weChatAuthLoginUrl' => 'http://hz.zhizhuchuxing.com/zzcx/user/login/auth-login?_a='. microtime(true),//第三方提供的微信授权登录路径
+ 'host_name' => 'http://hzfx.zhizhuchuxing.com',//网站域名
+ 'notify_url' => 'http://hz.zhizhuchuxing.com/zzcx/order/order/notify',//支付回调地址
+ 'adm_host' => 'http://cs.zhizhuchuxing.com',//管理后台地址
+ 'adm_host1' => 'http://cs1.zhizhuchuxing.com',//管理后台1地址
+ 'adm_user' => 'admin_036',//cs接口使用 用户名
+ 'adm_user_key' => 'admin_036',//cs接口使用 用户秘钥
+ 'adm_user_id' => 798,//cs接口使用 用户ID
+ 'adm_source_id' => '1734',//渠道来源编号
+ 'show_recom' => [25],//LBS定位的菜单栏ID
+ 'kefu_tel' => '021-33280519',//客服电话
+ 'YunYinPhone' => '18874559393',//运营通知电话
+ 'recharge_amount' => 1,//分销商户充值最低金额
+ 'pc_uid' => '',//分销PC端展示用户ID
+ 'zzcx_host' => 'http://hz.zhizhuchuxing.com',//下单
+ 'wxWeChat' => 'wx0376620fe134cef0',//微信公众号的APPID
+ 'wx_get_token'=> 'http://wx.zhizhuchuxing.com',
+ "apply_commission_min"=>50,//最低可提取佣金
+];
\ No newline at end of file
diff --git a/common/config/siteConfig/ksdev/siteConfig.php b/common/config/siteConfig/ksdev/siteConfig.php
new file mode 100644
index 0000000..1001caa
--- /dev/null
+++ b/common/config/siteConfig/ksdev/siteConfig.php
@@ -0,0 +1,37 @@
+ '昆山集散中心',//网站头
+ 'entryAuthWeChat' => 'wx81ac156a5c166881',//授权登录微信APPID
+ 'aliPay' => '',//阿里支付
+ 'weChatAuthLoginUrl' => 'http://ks.zhizhuchuxing.com/zzcx/user/login/auth-login?_a='. microtime(true),//第三方提供的微信授权登录路径
+ 'host_name' => 'http://ks.zhizhuchuxing.cn',//网站域名
+ 'notify_url' => 'http://ks.zhizhuchuxing.cn/zzcx/order/order/notify',//支付回调地址
+ 'adm_host' => 'http://sandbox.zhizhuchuxing.cn',//管理后台地址
+ 'adm_host1' => 'http://sandbox1.zhizhuchuxing.cn',//管理后台1地址
+ 'adm_user' => 'admin_034',//cs接口使用 用户名
+ 'adm_user_key' => 'admin_034',//cs接口使用 用户秘钥
+ 'adm_user_id' => 772,//cs接口使用 用户ID
+ 'adm_source_id' => '1660',//渠道来源编号
+ 'show_recom' => [25],//LBS定位的菜单栏ID
+ 'kefu_tel' => '021-33280519',//客服电话
+ 'YunYinPhone' => '18874559393',//运营通知电话
+ 'recharge_amount' => 1,//分销商户充值最低金额
+ 'pc_uid' => '',//分销PC端展示用户ID
+ 'zzcx_host' => 'http://ks.zhizhuchuxing.cn',//下单
+ 'wxWeChat' => 'wx81ac156a5c166881',//微信公众号的APPID
+ 'wx_get_token'=> 'http://ks.zhizhuchuxing.com',
+ "apply_commission_min"=>50,//最低可提取佣金
+];
\ No newline at end of file
diff --git a/common/config/siteConfig/kspro/siteConfig.php b/common/config/siteConfig/kspro/siteConfig.php
new file mode 100644
index 0000000..b742667
--- /dev/null
+++ b/common/config/siteConfig/kspro/siteConfig.php
@@ -0,0 +1,37 @@
+ '昆山集散中心',//网站头
+ 'entryAuthWeChat' => 'wx81ac156a5c166881',//授权登录微信APPID
+ 'aliPay' => '',//阿里支付
+ 'weChatAuthLoginUrl' => 'http://ks.zhizhuchuxing.com/zzcx/user/login/auth-login?_a='. microtime(true),//第三方提供的微信授权登录路径
+ 'host_name' => 'http://ksfx.zhizhuchuxing.com',//网站域名
+ 'notify_url' => 'http://ks.zhizhuchuxing.com/zzcx/order/order/notify',//支付回调地址
+ 'adm_host' => 'http://cs.zhizhuchuxing.com',//管理后台地址
+ 'adm_host1' => 'http://cs1.zhizhuchuxing.com',//管理后台1地址
+ 'adm_user' => 'admin_034',//cs接口使用 用户名
+ 'adm_user_key' => 'admin_034',//cs接口使用 用户秘钥
+ 'adm_user_id' => 772,//cs接口使用 用户ID
+ 'adm_source_id' => '1660',//渠道来源编号
+ 'show_recom' => [25],//LBS定位的菜单栏ID
+ 'kefu_tel' => '021-33280519',//客服电话
+ 'YunYinPhone' => '18874559393',//运营通知电话
+ 'recharge_amount' => 1,//分销商户充值最低金额
+ 'pc_uid' => '',//分销PC端展示用户ID
+ 'zzcx_host' => 'http://ks.zhizhuchuxing.com',//下单
+ 'wxWeChat' => 'wx81ac156a5c166881',//微信公众号的APPID
+ 'wx_get_token'=> 'http://wx.zhizhuchuxing.com',
+ "apply_commission_min"=>50,//最低可提取佣金
+];
\ No newline at end of file
diff --git a/common/config/siteConfig/kxpro/siteConfig.php b/common/config/siteConfig/kxpro/siteConfig.php
new file mode 100644
index 0000000..c759aec
--- /dev/null
+++ b/common/config/siteConfig/kxpro/siteConfig.php
@@ -0,0 +1,37 @@
+ '快行漫游',//网站头
+ 'entryAuthWeChat' => 'wxf5d1e7e3317bb073',//授权登录微信APPID
+ 'aliPay' => '',//阿里支付
+ 'weChatAuthLoginUrl' => 'http://kx.zhizhuchuxing.com/zzcx/user/login/auth-login?_a=' . microtime(true),//第三方提供的微信授权登录路径
+ 'host_name' => 'http://kxfx.zhizhuchuxing.com',//网站域名
+ 'notify_url' => 'http://kx.zhizhuchuxing.com/zzcx/order/order/notify',//支付回调地址
+ 'adm_host' => 'http://cs.zhizhuchuxing.com',//管理后台地址
+ 'adm_host1' => 'http://cs1.zhizhuchuxing.com',//管理后台1地址
+ 'adm_user' => 'admin_037',//cs接口使用 用户名
+ 'adm_user_key' => 'admin_037',//cs接口使用 用户秘钥
+ 'adm_user_id' => 813,//cs接口使用 用户ID
+ 'adm_source_id' => '1769',//渠道来源编号
+ 'show_recom' => [25],//LBS定位的菜单栏ID
+ 'kefu_tel' => '021-33280519',//客服电话
+ 'YunYinPhone' => '18874559393',//运营通知电话
+ 'recharge_amount' => 1,//分销商户充值最低金额
+ 'pc_uid' => '',//分销PC端展示用户ID
+ 'zzcx_host' => 'http://kx.zhizhuchuxing.com',//下单
+ 'wxWeChat' => 'wxf5d1e7e3317bb073',//微信公众号的APPID
+ 'wx_get_token' => 'http://wx.zhizhuchuxing.com',
+ "apply_commission_min" => 10,//最低可提取佣金
+];
\ No newline at end of file
diff --git a/common/config/siteConfig/pro/siteConfig.php b/common/config/siteConfig/pro/siteConfig.php
new file mode 100644
index 0000000..6fd48c2
--- /dev/null
+++ b/common/config/siteConfig/pro/siteConfig.php
@@ -0,0 +1,37 @@
+ '小黑鱼出行',//网站头
+ 'entryAuthWeChat' => 'wx34e2f2b38cfb15a1',//授权登录微信APPID
+ 'aliPay' => '2017030306030595',//阿里支付
+ 'weChatAuthLoginUrl' => 'http://fx.zhizhuchuxing.com/fx/?r=weChat/we-chat/login-redirect',//第三方提供的微信授权登录路径
+ 'host_name' => 'http://fx.zhizhuchuxing.com',//网站域名
+ 'notify_url' => 'http://wx.zhizhuchuxing.com/zzcx/order/order/notify',//支付回调地址
+ 'adm_host' => 'http://cs.zhizhuchuxing.com',//管理后台地址
+ 'adm_host1' => 'http://cs1.zhizhuchuxing.com',//管理后台1地址
+ 'adm_user' => 'newfx',
+ 'adm_user_key' => 'newfx_key',
+ 'adm_user_id' => 581,
+ 'adm_source_id' => '1285',
+ 'show_recom' => [25],//LBS定位的菜单栏ID
+ 'kefu_tel' => '021-33280519',//客服电话
+ 'YunYinPhone' => '18874559393',//运营通知电话
+ 'recharge_amount' => 1,//分销商户充值最低金额
+ 'pc_uid' => '',//分销PC端展示用户ID
+ 'zzcx_host' => 'http://wx.zhizhuchuxing.com',//下单
+ 'wxWeChat' => 'wxbe6da4af3e529e0c',//微信公众号的APPID
+ 'wx_get_token'=> 'http://wx.zhizhuchuxing.com',
+ "apply_commission_min"=>50,//最低可提取佣金
+];
\ No newline at end of file
diff --git a/common/config/siteConfig/qdh/siteConfig.php b/common/config/siteConfig/qdh/siteConfig.php
new file mode 100644
index 0000000..0b2f428
--- /dev/null
+++ b/common/config/siteConfig/qdh/siteConfig.php
@@ -0,0 +1,36 @@
+'蜘蛛出行',//网站头
+ 'entryAuthWeChat' => 'wxf945d8fb99f6250d',//授权登录微信APPID
+ 'aliPay' => '2017032106317613',//阿里支付
+ 'weChatAuthLoginUrl' => 'http://qdhfx.zhizhuchuxing.com/fx/?r=weChat/we-chat/login-redirect',//第三方提供的微信授权登录路径
+ 'host_name'=> 'http://qdhfx.zhizhuchuxing.cn',//网站域名
+ 'notify_url' => '/fx/wechat/notify/',//支付回调地址
+ 'adm_host' => 'http://sandbox.zhizhuchuxing.cn',//管理后台地址
+ 'adm_host1' => 'http://sandbox1.zhizhuchuxing.cn',//管理后台1地址
+ 'adm_user' => 'hzqdh',
+ 'adm_user_key' => 'hzqdh_key',
+ 'adm_user_id' => 450,
+ 'adm_source_id' => '1311',
+ 'show_recom' => [],//LBS定位的菜单栏ID
+ 'kefu_tel' => '400-105-1078',//客服电话
+ 'YunYinPhone' => '',//运营通知电话
+ 'recharge_amount' => 1,//分销商户充值最低金额
+ 'pc_uid' => 4,//分销PC端展示用户ID
+ 'zzcx_host' => 'http://nwx.zhizhuchuxing.cn',//下单
+ 'wxWeChat' => '',//微信公众号的APPID,
+ "apply_commission_min"=>50,//最低可提取佣金
+];
\ No newline at end of file
diff --git a/common/config/siteConfig/qdhpro/siteConfig.php b/common/config/siteConfig/qdhpro/siteConfig.php
new file mode 100644
index 0000000..376ce52
--- /dev/null
+++ b/common/config/siteConfig/qdhpro/siteConfig.php
@@ -0,0 +1,36 @@
+'蜘蛛出行',//网站头
+ 'entryAuthWeChat' => 'wxf945d8fb99f6250d',//授权登录微信APPID
+ 'aliPay' => '2017032106317613',//阿里支付
+ 'weChatAuthLoginUrl' => 'http://qdhfx.zhizhuchuxing.com/fx/?r=weChat/we-chat/login-redirect',//第三方提供的微信授权登录路径
+ 'host_name'=> 'http://qdhfx.zhizhuchuxing.com',//网站域名
+ 'notify_url' => '/fx/wechat/notify/',//支付回调地址
+ 'adm_host' => 'http://cs.zhizhuchuxing.com',//管理后台地址
+ 'adm_host1' => 'http://cs1.zhizhuchuxing.com',//管理后台1地址
+ 'adm_user' => 'hzqdh',
+ 'adm_user_key' => 'hzqdh_key',
+ 'adm_user_id' => 450,
+ 'adm_source_id' => '1311',
+ 'show_recom' => [],//LBS定位的菜单栏ID
+ 'kefu_tel' => '400-105-1078',//客服电话
+ 'YunYinPhone' => '13625816476',//运营通知电话
+ 'recharge_amount' => 1,//分销商户充值最低金额
+ 'pc_uid' => 4,//分销PC端展示用户ID
+ 'zzcx_host' => 'http://fx.zhizhuchuxing.com',//下单
+ 'wxWeChat' => '',//微信公众号的APPID,
+ "apply_commission_min"=>50,//最低可提取佣金
+];
\ No newline at end of file
diff --git a/common/config/siteConfig/yyt/siteConfig.php b/common/config/siteConfig/yyt/siteConfig.php
new file mode 100644
index 0000000..fd2e0c8
--- /dev/null
+++ b/common/config/siteConfig/yyt/siteConfig.php
@@ -0,0 +1,34 @@
+'运游通',//网站头
+ 'entryAuthWeChat' => 'wxae738c8d5654e01d',//授权登录微信APPID
+ 'aliPay' => '2016102100728544',//阿里支付
+ 'weChatAuthLoginUrl' => 'http://yybs.njyunyoutong.com/module/wxInterface/authLogin?ma='.rand(1000,9000),//第三方提供的微信授权登录路径
+ 'host_name'=> 'http://fxtest.njyunyoutong.com/',//网站域名
+ 'notify_url' => '/fx/wechat/notify/',//支付回调地址
+ 'adm_host' => 'http://cs.zhizhuchuxing.com',//管理后台地址
+ 'adm_host1' => 'http://cs1.zhizhuchuxing.com',//管理后台1地址
+ 'adm_user' => 'newfx',
+ 'adm_user_key' => 'newfx_key',
+ 'adm_user_id' => 581,
+ 'adm_source_id' => '1285',
+ 'show_recom' => [25],//LBS定位的菜单栏ID
+ 'kefu_tel' => '021-33280519',//客服电话
+ 'YunYinPhone' => '',//运营通知电话
+ 'recharge_amount' => 1,//分销商户充值最低金额
+ 'pc_uid' => 4,//分销PC端展示用户ID,
+ "apply_commission_min"=>50,//最低可提取佣金
+];
\ No newline at end of file
diff --git a/common/config/wechatConfig/cert/1329733601/apiclient_cert.pem b/common/config/wechatConfig/cert/1329733601/apiclient_cert.pem
new file mode 100644
index 0000000..72c2ac8
--- /dev/null
+++ b/common/config/wechatConfig/cert/1329733601/apiclient_cert.pem
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEZTCCA86gAwIBAgIDHYb3MA0GCSqGSIb3DQEBBQUAMIGKMQswCQYDVQQGEwJD
+TjESMBAGA1UECBMJR3Vhbmdkb25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4GA1UE
+ChMHVGVuY2VudDEMMAoGA1UECxMDV1hHMRMwEQYDVQQDEwpNbXBheW1jaENBMR8w
+HQYJKoZIhvcNAQkBFhBtbXBheW1jaEB0ZW5jZW50MB4XDTE2MDQwNjEyNTAyNVoX
+DTI2MDQwNDEyNTAyNVowgZUxCzAJBgNVBAYTAkNOMRIwEAYDVQQIEwlHdWFuZ2Rv
+bmcxETAPBgNVBAcTCFNoZW56aGVuMRAwDgYDVQQKEwdUZW5jZW50MQ4wDAYDVQQL
+EwVNTVBheTEqMCgGA1UEAxQh6JyY6Jub6KGM572R57uc56eR5oqA5pyJ6ZmQ5YWs
+5Y+4MREwDwYDVQQEEwgxMTc3NDYwNDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
+AQoCggEBAMJqPHEeUQvWZQWl5W/QvI/MR97jCY6iArnfPPkLBgWY6lEh7cGFn5Fq
+C2DsTHxuUC/7si9Sq5QHA2K8VaLk8qYDj2CurT0yRFVAVss/NYfPerZ6nHLbEB4p
+dYg6jUvQVWe7n5hJScq+89MNGUOpgF4uCCD/HyUDpRT8MFRQ+yGDTpuCjqZwexgM
+e0jNTKwvCXVwLcgR9LFknSiJCxDHAqauqd4r+ZAjDU4CZ/JWdeyLuRUqwxz4kECE
+S9iC79mhyo/KwoUupsZKp8RKacrhHybqMjgyZNFsVueLHjcDpYkMgrpUQU6QBJv6
+pLqOPejSQg99ddJNBTJJwwffU2mrDG0CAwEAAaOCAUYwggFCMAkGA1UdEwQCMAAw
+LAYJYIZIAYb4QgENBB8WHSJDRVMtQ0EgR2VuZXJhdGUgQ2VydGlmaWNhdGUiMB0G
+A1UdDgQWBBTIibbUnV9kTejncwyzXb81/xqj9TCBvwYDVR0jBIG3MIG0gBQ+BSb2
+ImK0FVuIzWR+sNRip+WGdKGBkKSBjTCBijELMAkGA1UEBhMCQ04xEjAQBgNVBAgT
+CUd1YW5nZG9uZzERMA8GA1UEBxMIU2hlbnpoZW4xEDAOBgNVBAoTB1RlbmNlbnQx
+DDAKBgNVBAsTA1dYRzETMBEGA1UEAxMKTW1wYXltY2hDQTEfMB0GCSqGSIb3DQEJ
+ARYQbW1wYXltY2hAdGVuY2VudIIJALtUlyu8AOhXMA4GA1UdDwEB/wQEAwIGwDAW
+BgNVHSUBAf8EDDAKBggrBgEFBQcDAjANBgkqhkiG9w0BAQUFAAOBgQAHelavW3WB
+2qBtcG0uEVPLYlWKMvYpO79QUaWPYWh9bywA9d2zqoM8LfWgkOJtmetNdiqh3RVf
+/DrKWsLalluaLIMEHuX2chnvtT7vIO4ILijgP/4MZ9k8Jpmi3tKUfFpJVA7E4MXa
+7vM5gl21FRuqB96m24tynWHjmgshc4Kk2g==
+-----END CERTIFICATE-----
diff --git a/common/config/wechatConfig/cert/1329733601/apiclient_key.pem b/common/config/wechatConfig/cert/1329733601/apiclient_key.pem
new file mode 100644
index 0000000..fdb2e29
--- /dev/null
+++ b/common/config/wechatConfig/cert/1329733601/apiclient_key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBg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t6ykoNQWS3lzZ4KLHNC1lDwMsd6VmMMr3Ys
+iGH4nYYbowKBgDc7kRfCaDc6ziMo3tXhSPIpWFvA0VmSB/cLhqBVq6FtkaOr5S9M
+JhpsmDVK7B3P9Hn++Fx+QZCmh5/Vq1ZWaiVxz03H8mcWoi2ri8UOnLRMGObSKURs
+gcVKbcPUYbeA1xIpIdKQygTtiM0owlrt0rwHzSpd8Ioblx47+7mVYpWnAoGBAKgu
+QMZToZNoo0S5OiBZA6iyLNAKsgxA2n4QMSoSlpNO3L3DUAfR4odzN9zUukT8d+1+
+WYrmLRp6FlyOAdTKFwwMEClUlA/wlQuYN3uPVBoIbretqoNtx0yM9PZa7T2dNgfi
+tPv/b/vNHHdH7jPJbyEV123d4QgcCeIhp9ZWGikPAoGBAMUbx9snnBwswUae+Dv2
+NkH02dv7oPQnPWKbk8b1s/LQEuisYO+34Aofx1ik5MmAZBN/3x8Cn7/i0eOKEUnd
+TRsJuiiSFLYdNISDUBQ4R263uSewow9kagrk/lwQgZ/6pJSXQH9G1ycNeZxmR3dq
+XevCR+GjHIwTFaYo4XOBYoNw
+-----END PRIVATE KEY-----
diff --git a/common/config/wechatConfig/cert/1424400302/apiclient_cert.pem b/common/config/wechatConfig/cert/1424400302/apiclient_cert.pem
new file mode 100644
index 0000000..65958be
--- /dev/null
+++ b/common/config/wechatConfig/cert/1424400302/apiclient_cert.pem
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEcTCCA9qgAwIBAgIDbv1AMA0GCSqGSIb3DQEBBQUAMIGKMQswCQYDVQQGEwJD
+TjESMBAGA1UECBMJR3Vhbmdkb25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4GA1UE
+ChMHVGVuY2VudDEMMAoGA1UECxMDV1hHMRMwEQYDVQQDEwpNbXBheW1jaENBMR8w
+HQYJKoZIhvcNAQkBFhBtbXBheW1jaEB0ZW5jZW50MB4XDTE2MTIxNTAyNTEzMVoX
+DTI2MTIxMzAyNTEzMVow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KBggrBgEFBQcDAjANBgkqhkiG9w0BAQUF
+AAOBgQDBdRAOavYhQEaMyVtISWfTNxW5HIH5gguTSwH9w7nGTlZf5C6OGUL3OZEG
+3fQ+ve2FxiNAUAqTiG8BsiY7higf5fD2kTaupwPZ9b5jKIHkBVq+Q/TkO57JnlWA
+Xuya8V0laO7T/FBL7hZqHPUH/ffJYq4GtluwrJ7I/5k0GOLDxw==
+-----END CERTIFICATE-----
diff --git a/common/config/wechatConfig/cert/1424400302/apiclient_key.pem b/common/config/wechatConfig/cert/1424400302/apiclient_key.pem
new file mode 100644
index 0000000..56528cf
--- /dev/null
+++ b/common/config/wechatConfig/cert/1424400302/apiclient_key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDg2YbMru0icMge
+HUxvFRTBnBkB4VMUFQfsrtkDozCyaedyLo4iIQI00ahvRKrnpP0foeqAp5nk4w+s
+VwvZ6LYLp7T2Hl0jxzIxExcvxRyZaiJt9Po0VyANEXiP1onqpeT/bA607MLfmNKT
+Q5gKJxi3SlOBbIWVgY5Q3ZjoiRoLNWulBD+0A1vyGBMFA9nqK0G2PQ5UX9ThaoR7
+B220G3Zt0tPMA2pJX96a556lb02721ubeWCuOCAcyT8oYLhTB3JU20cvhOjGWW9v
+HMGF5aemlnudCA4BVtONiGrVt46CrlrFTmUWZTr15o5etKLl7g1wOuVkWG610Sni
+/5me/ONdAgMBAAECggEBAMFD1+zZMnSW8juIPWmBejzMOmZ2UZ2CUjRrOZc5zqKc
+CtcHEx5ctvPFffxdznSbSQLGfrUk2k91p8Qfcc1UjB1Kgm3GPZKCJi8uVJC34VQw
+ePWASwtwE9mHudQQuKza+RFexOlYVEwypFT2FZosbr8lAM/PAqc2G6iAQG0nYx5b
+qD9JG0dWM8weEHdWVUrqPjKxBbmAAw9s/eBK/EdNiBV/bbaV5R5D0vCmZNIEwHuM
+9NuYTpX6gyNFK7bWfhOUaAHq8DVT8RW3+0U8Rs852wgA80IsV4TR/z0qUzYQA90Q
+7IRBugOqO7rTPnWdgIfU7Vhy2grfnJgaQy/zi+r58IECgYEA/uCWSGdWJ43bjDMQ
+0QvdyjLtz+fVt5NrVfqXwGujyiMGD+cL6Kv26NG8t2p42dPxAbSeTMlhdOPN5nay
+8XAYDpn210kqLYjtVIep2QsX3hc55ODnBmUhXAs3gEubCZmdjGEnHNNyupKZhgN9
++SnaQ2BIvvKJQHOhYNKPyQE+UD0CgYEA4dcUL37g02Zi+ujEvtBDEqosdl6pXpSy
+RvDrYJ1rgDuDn74H32VVuNYi4m3sQcvQe01FeWsRAcUy0B7lv4h0g/Q/4wkD4NkH
+KBwQOP+Aj3MDQ5+PJDVal1RRZWw+VMKmwY+jqUpwrNHiTDK/tn6KsnTC/S017BF3
+CvtwAst/8aECgYEA94DuTwcSMbzeuymHpgjI6qZEK0WtUuQ0Mjzziia82fji1SR/
+ewUq8vFhOheJnbXjbs2Pf297VQA2nRsdL7mzktJOUsc4zxkNpq1K8XqFReT2El2X
+2qzwFSrLTamdt1fWF1Dso2BuI+FidjID7aaHzi+81Lg/MjhXOOegOwgbE90CgYAi
+DMR9WLrbBK/dtqSbRFkogkHL4v/UQ8URTxed7H4dyltRBVy4gNXI1XhS/VHGpc0c
+Gg1kfhEFXE8J8+6dzxwKHRRYza4pA2/By2FixpsChcuzMWZqhiTPdiYDjatkKijs
+PBTn3FJarBZbeLdQ84lD2LjhZSShIAz7uecsdLQooQKBgQCE0NibkVvSsZ4LoZEi
+jWV78S6qXU1g0ANsKNF3dOoaXo3p8DknpS/oJ1/OA78IlKB/WQPOWsPpXQsOXkZx
+qcdNgJnV8j3DvOr+Tm8rzl3HKCucQef7IfSbW1aJD+TX6rFVMeHydY6lSB8oeJLY
+nRpxVJWSOOjXAIIu9t9nExQQgw==
+-----END PRIVATE KEY-----
diff --git a/common/config/wechatConfig/cert/1439003102/apiclient_cert.pem b/common/config/wechatConfig/cert/1439003102/apiclient_cert.pem
new file mode 100644
index 0000000..f513766
--- /dev/null
+++ b/common/config/wechatConfig/cert/1439003102/apiclient_cert.pem
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEbDCCA9WgAwIBAgIEAJaVazANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC
+Q04xEjAQBgNVBAgTCUd1YW5nZG9uZzERMA8GA1UEBxMIU2hlbnpoZW4xEDAOBgNV
+BAoTB1RlbmNlbnQxDDAKBgNVBAsTA1dYRzETMBEGA1UEAxMKTW1wYXltY2hDQTEf
+MB0GCSqGSIb3DQEJARYQbW1wYXltY2hAdGVuY2VudDAeFw0xNzAyMDgxMTIwMDZa
+Fw0yNzAyMDYxMTIwMDZaMIGbMQswCQYDVQQGEwJDTjESMBAGA1UECBMJR3Vhbmdk
+b25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4GA1UEChMHVGVuY2VudDEOMAwGA1UE
+CxMFTU1QYXkxMDAuBgNVBAMUJ+WNl+S6rOi/kOa4uOmAmue9kee7nOenkeaKgOac
+iemZkOWFrOWPuDERMA8GA1UEBBMIMTk5NTIwNjUwggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQDPwnYEO8Qy9b74W9bgwuYFphegYsL1Hyb7K7c4nSW7bhwQ
+8yThF2V2XAzVNFlV3n30K1zr3x7Bh5HDsIHVNO1/HiNX53P+5hX7hndqxY0KzzZx
+N/onn7Ttm8T9IIhiFqmEj72VNoi90xcsmVLrrSLstjkFTlnt++r/hG0gOz4dVi+y
+8uHO5qMV3moxQr+Xbd/B9EJTk74ec9ix3oO5usBAxd8FIFfCJXnQm9DQDQ0j4/pE
+7zsk1X9hq0RO3YMLzmM2yFV3iFEje5hcXd08raLS5m/elviW7wyEFfEE4njCztbb
+zgLR8FTWSieOmZ7fMiPNnp+V8aMRNIPxaEU/f6JdAgMBAAGjggFGMIIBQjAJBgNV
+HRMEAjAAMCwGCWCGSAGG+EIBDQQfFh0iQ0VTLUNBIEdlbmVyYXRlIENlcnRpZmlj
+YXRlIjAdBgNVHQ4EFgQUs+N0We1skjwMxRjMPPMy8EaLqycwgb8GA1UdIwSBtzCB
+tIAUPgUm9iJitBVbiM1kfrDUYqflhnShgZCkgY0wgYoxCzAJBgNVBAYTAkNOMRIw
+EAYDVQQIEwlHdWFuZ2RvbmcxETAPBgNVBAcTCFNoZW56aGVuMRAwDgYDVQQKEwdU
+ZW5jZW50MQwwCgYDVQQLEwNXWEcxEzARBgNVBAMTCk1tcGF5bWNoQ0ExHzAdBgkq
+hkiG9w0BCQEWEG1tcGF5bWNoQHRlbmNlbnSCCQC7VJcrvADoVzAOBgNVHQ8BAf8E
+BAMCBsAwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADgYEA
+wQ3mmhwF6GU6uzy5aTZwQATYDl06xCeXLy2DlGONii+xJ3Yj3ZVFS5voKAKhapXp
+qt+b+Gm8zIZq/lFofVxTbeyDxg2yyZsBQ9ibbAWK61qAY0rYPMYTSc5YbAs5SLsH
+fPDpuIv1Fu2vXGTmc9Q7SoT4gXLqj7kUBVN84KnVsSc=
+-----END CERTIFICATE-----
diff --git a/common/config/wechatConfig/cert/1439003102/apiclient_key.pem b/common/config/wechatConfig/cert/1439003102/apiclient_key.pem
new file mode 100644
index 0000000..1f421c6
--- /dev/null
+++ b/common/config/wechatConfig/cert/1439003102/apiclient_key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDPwnYEO8Qy9b74
+W9bgwuYFphegYsL1Hyb7K7c4nSW7bhwQ8yThF2V2XAzVNFlV3n30K1zr3x7Bh5HD
+sIHVNO1/HiNX53P+5hX7hndqxY0KzzZxN/onn7Ttm8T9IIhiFqmEj72VNoi90xcs
+mVLrrSLstjkFTlnt++r/hG0gOz4dVi+y8uHO5qMV3moxQr+Xbd/B9EJT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XbqfZqn6KfbL6rpDa/Cx8Nc6uaEgVylNse30a/7OYnHbsX8Y9E2mdLkoJDcposS
+n5C/EiVrOUZwDPwY/vTnU3UgaHnVGtBVDzO4syNIE1qH/b2G+z6Xf93iM0RvY9SR
+IkVcQHMDDkknkLc9iqu33OwL2ZHI5KmpmgRLl0TFAoGBAKM0ItpOQzZXZbIJ5qVv
+SRCs6DoaOMnnNFzazJiygS04jD0hvENgO4yXc0DBbNLaLncK7CIo8W2hJk7Mvedi
++e1Kuho/0RcdL+h7gIvgFbGcsDFxe4we+BAyMv8D9JpZ8YQRKVsyvVlYWGGG3K3m
+4zHqOVp/wQL8G+UghjUmc2+N
+-----END PRIVATE KEY-----
diff --git a/common/config/wechatConfig/cert/1443331502/apiclient_cert.p12 b/common/config/wechatConfig/cert/1443331502/apiclient_cert.p12
new file mode 100644
index 0000000..b040fa5
Binary files /dev/null and b/common/config/wechatConfig/cert/1443331502/apiclient_cert.p12 differ
diff --git a/common/config/wechatConfig/cert/1443331502/apiclient_cert.pem b/common/config/wechatConfig/cert/1443331502/apiclient_cert.pem
new file mode 100644
index 0000000..83e4e76
--- /dev/null
+++ b/common/config/wechatConfig/cert/1443331502/apiclient_cert.pem
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEbzCCA9igAwIBAgIEAKwMkTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC
+Q04xEjAQBgNVBAgTCUd1YW5nZG9uZzERMA8GA1UEBxMIU2hlbnpoZW4xEDAOBgNV
+BAoTB1RlbmNlbnQxDDAKBgNVBAsTA1dYRzETMBEGA1UEAxMKTW1wYXltY2hDQTEf
+MB0GCSqGSIb3DQEJARYQbW1wYXltY2hAdGVuY2VudDAeFw0xNzAyMjQwMzEwMDla
+Fw0yNzAyMjIwMzEwMDlaMIGeMQswCQYDVQQGEwJDTjESMBAGA1UECBMJR3Vhbmdk
+b25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4GA1UEChMHVGVuY2Vud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4KCfwR8
+nY9btBuMxjyMcEMDfgDXWczMtC0GyfAHfv2HbfpJ0SJ8kFa6Mq41BCusYwWaUv9Q
+hetuxhC1oIlyVzayA87aYXouuQjZO6bFOeAICJeVZAopu1o=
+-----END CERTIFICATE-----
diff --git a/common/config/wechatConfig/cert/1443331502/apiclient_key.pem b/common/config/wechatConfig/cert/1443331502/apiclient_key.pem
new file mode 100644
index 0000000..18db426
--- /dev/null
+++ b/common/config/wechatConfig/cert/1443331502/apiclient_key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCv6lbfzD1Mt7z2
+8mMVd99MUjzOgSQicVJAoAw75oobk64LZseAV8FooGg8d8zbeq0luLQ72KekrdZg
+ACAPkJFDrsz3OPFjCPl0KY9jhTt861NDSlPtlxXRgX/greDqPhXWSbEFGcMo2kBH
+vftQl3QG8xeDHDNCVS2cTj+w57ANOU6R2xAXIbC3FIn6jxQTKuxSZ4E98j0cYtf3
+nVzMgB229lVeYQJ1CUr+Hs+33cPgNBsKgBUR6XuzF7lslBX0mHmS5RsnXvSA6sIM
+Bi2cDbLL/j3q8AZ9LGF/aZfrJIOlTI/yjlL2aXrqtWBNd9eIRKOm64ATJL2/WrgJ
+kf4vHlwnAgMBAAECggEASLUTaPZSU7YRXQO7njDoUvQee792fuHVfC5qQAu+Az3b
+jozRYiNjJeo+itd9DS28CL45iA6442CSHSWQGr7Gu3Gw93FKm4MnDzLqN9jmSHA+
+/q3m2Gk8tFXQ070qG8bDYckdaB1Iw0bJkJ1eFOY0J3crvZ3XNdBcxKC2xFhONHhO
+o6i6VloubOCNk1ZNUieGgp1xt6nfXn4qt3tcD51gPwWYVoPGceKZUiNOhTlRTORc
+4X/lyMccXQei8M2C0XEUzMvsULdLB73lPGK6WMEnzWFNsAcBMGaBPiJrJV2m+iHV
+LWGazPR+kjmy4J9OuofdOZUzonxS4Cozmj2MXEOVKQKBgQDYYIavuf1zzIyYaPXw
+i4baef0wkalsDYtvFD9llAQcRs/PgGIj2U9zlPzedqhfKa8HK7yEYFqnLWfSWsYS
+zPhW/u/dusaOLKmQuTVtmPNKAf+HkNJ62/PQVs6FnP/53Oy+AzvCxsKdrh1XVmma
+5gL73qzouKGJMqDi/O2TLAS37QKBgQDQIQXp/SvA7XOcNUWy6qHmLifLr8HAbh8k
+G10ZvG0TBc8bYaNMhueoeEupl44AVOTWa7875H/9n5emzGRhu07pIFYybTacwdvj
+JsFM1lt0m3KZpWe75HCHqer8m5OwQofXnObzvOxJVxeOiI1s669zRwt/NYpdoPNL
+8tbrK3m54wKBgQCReMv0hunUmbgIm8CFuXivmAZWSggKwkx1ILrCszHURPNgAWN5
+0JcvEQK1Gjd2y1KGUqxKn3EzJj6/2RGEAFQSQRHJE9J8MaDK0QoPph4jKpa+cOph
+eVFBR6tPf09FkHeGBCyAdhrP4giN+GXFo1BsP7gmOkM4N1adZQjgwl5lvQKBgQCV
+h7RFCVSfFrph91AtHC/XPT/wMkUEqNmMynAYJm1DJoBGzt5RA/d57XuGy9EE4flL
+KDxLnn5qTHfbKavRH46xJT9omViMRSdiypxERRmN7IToaJLfxl8myOiANpJkJ1iL
+iznO0eP9SSouiGL7Z1U1gEx9R40yeYly/nR0n1akOwKBgA1boMebTv47D/9tky6R
+R4kdfrNzkzHuV6mVxp7adgXqkRVY2uTEF5zU4JnZixXdjAX3f/9IjapOt/LxpK7z
+2oCHdgdeJXCQJbwsnl59HclEoVqq7gBEzpqIqo/l5Rv1ta0/ZjRHI9J5L8mmUAYy
+mXaOWBrrcTPyww4qvCv8m7rI
+-----END PRIVATE KEY-----
diff --git a/common/config/wechatConfig/cert/1443331502/rootca.pem b/common/config/wechatConfig/cert/1443331502/rootca.pem
new file mode 100644
index 0000000..7a36225
--- /dev/null
+++ b/common/config/wechatConfig/cert/1443331502/rootca.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDIDCCAomgAwI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cPGUIWVEX/r87yloqaKHee9570+sB3c4
+-----END CERTIFICATE-----
\ No newline at end of file
diff --git a/common/config/wechatConfig/cert/1443331502/证书使用说明.txt b/common/config/wechatConfig/cert/1443331502/证书使用说明.txt
new file mode 100644
index 0000000..e8a73dd
--- /dev/null
+++ b/common/config/wechatConfig/cert/1443331502/证书使用说明.txt
@@ -0,0 +1,20 @@
+欢迎使用微信支付!
+微信支付API共四份(证书pkcs12格式、证书pem格式、证书密钥pem格式、CA证书),为接口中强制要求时需携带的证书文件。
+证书属于敏感信息,请妥善保管不要泄露和被他人复制。
+不同开发语言下的证书格式不同,以下为说明指引:
+ 证书pkcs12格式(apiclient_cert.p12)
+ 包含了私钥信息的证书文件,为p12(pfx)格式,由微信支付签发给您用来标识和界定您的身份
+ 部分安全性要求较高的API需要使用该证书来确认您的调用身份
+ windows上可以直接双击导入系统,导入过程中会提示输入证书密码,证书密码默认为您的商户ID(如:10010000)
+ 证书pem格式(apiclient_cert.pem)
+ 从apiclient_cert.p12中导出证书部分的文件,为pem格式,请妥善保管不要泄漏和被他人复制
+ 部分开发语言和环境,不能直接使用p12文件,而需要使用pem,所以为了方便您使用,已为您直接提供
+ 您也可以使用openssl命令来自己导出:openssl pkcs12 -clcerts -nokeys -in apiclient_cert.p12 -out apiclient_cert.pem
+ 证书密钥pem格式(apiclient_key.pem)
+ 从apiclient_cert.p12中导出密钥部分的文件,为pem格式
+ 部分开发语言和环境,不能直接使用p12文件,而需要使用pem,所以为了方便您使用,已为您直接提供
+ 您也可以使用openssl命令来自己导出:openssl pkcs12 -nocerts -in apiclient_cert.p12 -out apiclient_key.pem
+ CA证书(rootca.pem)
+ 微信支付api服务器上也部署了证明微信支付身份的服务器证书,您在使用api进行调用时也需要验证所调用服务器及域名的真实性
+ 该文件为签署微信支付证书的权威机构的根证书,可以用来验证微信支付服务器证书的真实性
+ 某些环境和工具已经内置了若干权威机构的根证书,无需引用该证书也可以正常进行验证,这里提供给您在未内置所必须根证书的环境中载入使用
\ No newline at end of file
diff --git a/common/config/wechatConfig/cert/1503844711/apiclient_cert.p12 b/common/config/wechatConfig/cert/1503844711/apiclient_cert.p12
new file mode 100644
index 0000000..4549742
Binary files /dev/null and b/common/config/wechatConfig/cert/1503844711/apiclient_cert.p12 differ
diff --git a/common/config/wechatConfig/cert/1503844711/apiclient_cert.pem b/common/config/wechatConfig/cert/1503844711/apiclient_cert.pem
new file mode 100644
index 0000000..e6dfc11
--- /dev/null
+++ b/common/config/wechatConfig/cert/1503844711/apiclient_cert.pem
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEczCCA9ygAwIBAgIEAfU6HjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC
+Q04xEjAQBgNVBAgTCUd1YW5nZG9uZzERMA8GA1UEBxMIU2hlbnpoZW4xEDAOBgNV
+BAoTB1RlbmNlbnQxDDAKBgNVBAsTA1dYRzETMBEGA1UEAxMKTW1wYXltY2hDQTEf
+MB0GCSqGSIb3DQEJARYQbW1wYXltY2hAdGVuY2VudDAeFw0xODA1MjEwMjM3MTZa
+Fw0yODA1MTgwMjM3MTZaMIGiMQswCQYDVQQGEwJDTjESMBAGA1UECBMJR3Vhbmdk
+b25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4GA1UEChMHVGVuY2VudDEOMAwGA1UE
+CxMFTU1QYXkxNjA0BgNVBAMULeaYhuWxseaWh+WVhuaXheaXhea4uOmbhuaVo+S4
+reW/g+aciemZkOWFrOWPuDESMBAGA1UEBBMJMTAwMzUzMDA0MIIBIjANBgkqhkiG
+9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5yLNsqgq8Au4TgvP1U227rbMmarO84SRYr83
+INGUx1+5m06Goc/Vhhe98j7Jh5SCqZ4c5yLNAqxk22lgO9bdaaYFU12LacNla8hg
+a/eIUFh1UGXvLBBwfIzSpR0Nj5CzJPCCon21I7km2gqtqGAbIz0qELfmgSwQEuu+
+f6XKp1Dqs5axQ8Cq8YuRZ1Q7nobCckeMHpk22PPS/D92VBuHrFxpDcELr58vRxAu
+iLflKP+6sJvaQD5+xXeBY/Vz4SpFnFkVuejYTAaIjFX5KyWDIVUf3/cMyMdrS+4e
+khePRE4FP3AvoShUiUAb8Ym2/1202+RzsIYseZBXdPEshWNG6wIDAQABo4IBRjCC
+AUIwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdIkNFUy1DQSBHZW5lcmF0ZSBD
+ZXJ0aWZpY2F0ZSIwHQYDVR0OBBYEFERVFmAA70bqm52Yw05ySW5n6YijMIG/BgNV
+HSMEgbcwgbSAFD4FJvYiYrQVW4jNZH6w1GKn5YZ0oYGQpIGNMIGKMQswCQYDVQQG
+EwJDTjESMBAGA1UECBMJR3Vhbmdkb25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4G
+A1UEChMHVGVuY2VudDEMMAoGA1UECxMDV1hHMRMwEQYDVQQDEwpNbXBheW1jaENB
+MR8wHQYJKoZIhvcNAQkBFhBtbXBheW1jaEB0ZW5jZW50ggkAu1SXK7wA6FcwDgYD
+VR0PAQH/BAQDAgbAMBYGA1UdJQEB/wQMMAoGCCsGAQUFBwMCMA0GCSqGSIb3DQEB
+BQUAA4GBAEWMBa8sGubX8dkM5nMO5ONcnU39R0wamvcKx+SG8PcRTBpIGOyJUtQK
+uWDpleqRsdoXKUsO6nerlPTYKHZii+NONRzEmGrOgIxJwk/POtbFkxthW1hui62Z
+uZqtDXV5nZw6T91MTo8C6+KRp74SjNAaTqvazNVW9TdPukDoh9Db
+-----END CERTIFICATE-----
diff --git a/common/config/wechatConfig/cert/1503844711/apiclient_key.pem b/common/config/wechatConfig/cert/1503844711/apiclient_key.pem
new file mode 100644
index 0000000..29ec23c
--- /dev/null
+++ b/common/config/wechatConfig/cert/1503844711/apiclient_key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDnIs2yqCrwC7hO
+C8/V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zXGUz2Cem9+xjYAHZ/XmYWSGBbJwgRk7F3vIjSnja55EtUqw7x
+v53KztGkSOCCfaQwG9h3E2jbmNDwOp3xDZDm0lStYPYDxs1uq1h6mGmmlo3ENm8+
+HwT20jBFELmh7EI+l5IgBZTubmy8092ZRq+K3LsKG/sGXLFfBVc13rAlAoGBANHH
+eyg818dOlqgl44SSInQcAL3QwEUvaHovcNkjL0yDb2/U3SUXWWynF4BgFc4JLblR
+YYqdvLwr9cYy6UuUPV8lxGIb7m7hadyT37yob61PrEgqHHfDwNtuOKzkHdsOws+4
+nE32CnRJghTNPq4vyc6ONe2+ywsL1L8smBp3Cm21AoGBAJ5kjtvGnvolh+75Np06
+50sMkY4qQ5IqA5w7qL0tv6EbAHUau+novsmMtWPGO+H/VqslN52IjBszMsa+MSV3
+hW6EQ+oO7PPhLc7b1GfZks8MnXsjKpONxO29A8ipLpHs8P1HoC5sb0SSLPnEUk4f
+IvOhWwmLdg4rVF3nKYqembj/
+-----END PRIVATE KEY-----
diff --git a/common/config/wechatConfig/cert/1515696111/apiclient_cert.p12 b/common/config/wechatConfig/cert/1515696111/apiclient_cert.p12
new file mode 100644
index 0000000..f86e29f
Binary files /dev/null and b/common/config/wechatConfig/cert/1515696111/apiclient_cert.p12 differ
diff --git a/common/config/wechatConfig/cert/1515696111/apiclient_cert.pem b/common/config/wechatConfig/cert/1515696111/apiclient_cert.pem
new file mode 100644
index 0000000..30e59e2
--- /dev/null
+++ b/common/config/wechatConfig/cert/1515696111/apiclient_cert.pem
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEcDCCA9mgAwIBAgIEAkLd8TANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC
+Q04xEjAQBgNVBAgTCUd1YW5nZG9uZzERMA8GA1UEBxMIU2hlbnpoZW4xEDAOBgNV
+BAoTB1RlbmNlbnQxDDAKBgNVBAsTA1dYRzETMBEGA1UEAxMKTW1wYXltY2hDQTEf
+MB0GCSqGSIb3DQEJ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ZW5jZW50ggkAu1SXK7wA6FcwDgYDVR0P
+AQH/BAQDAgbAMBYGA1UdJQEB/wQMMAoGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUA
+A4GBAMBj/bTCUnZvNGuTi+5WyAQ6Vs880Y4/aFSWMQjp80bFBdg3y6GZoS/KBaXi
+/0Y71PeN8QzWBFHETifWFcOmBEJdfQa/joRILDwL1uaM/YCQo9OKvtgFEbeG3prP
+8zOLaSPkaSalWVB97t12/oF73RkZLfnvcNbg/tw6OoQM4yo5
+-----END CERTIFICATE-----
diff --git a/common/config/wechatConfig/cert/1515696111/apiclient_key.pem b/common/config/wechatConfig/cert/1515696111/apiclient_key.pem
new file mode 100644
index 0000000..c8e26ea
--- /dev/null
+++ b/common/config/wechatConfig/cert/1515696111/apiclient_key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC6NieUaOxQsqJH
+Djs2Yieb8P7SiNj5cjsZ9S0hUBKu6I5mBVU79+ZnDkz3WOQovGV+mRLkk6W7RKoa
+V1ZFSbpgLj2TrSFR6wDFtRrK5NlKibmphDHQ8fhNTs46hgFlVd9gnmueX1LHtXfG
+6ygINtlk0TyuQjn2Pn8nPu6RowCbebix7LIaL6enZGicx9XYSXRg7iRQXmQt79+B
+QXhpcB72sJOT8Ixv62hRDY6oDdKqKoi0tQn5VYE17VnreLCPVem1f/omTuwaTDFV
+aLh3k2rUa1sXezxnviVpkRFvFGcixeDhyMXsYgS7yLfjr10fdhZQs81+yRXyNIiy
+SEy3bzRRAgMBAAECggEBAKBDA4WDV/+L/oZRBT0k9RoNLANeq/7kBWGt1Y2aMLpA
+hG3hoR3fmXiQokUvSA6XNnLio5P+TuEBk7Tf/evcLH+izHRQySCLtTpzR//fPfQc
+3KG8mHNQDXfbnzpXItRoN7wcHFtNhx1CXTfiI64OJsPSIPuJHAGGgEDytLi7JUao
+37Uq42/TmA1dNh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qntPwrt
+-----END PRIVATE KEY-----
diff --git a/common/config/wechatConfig/payConfig.php b/common/config/wechatConfig/payConfig.php
new file mode 100644
index 0000000..a85684c
--- /dev/null
+++ b/common/config/wechatConfig/payConfig.php
@@ -0,0 +1,105 @@
+ [
+ 'appid' => 'wxae738c8d5654e01d',//微信开放平台审核通过的应用APPID
+ 'appsecret' => '5751c2e6f4cfbd07140bb09d3c16171c',//secret
+ 'appName' => '运游通',//名称
+ 'mch_id' => '1439003102',//微信支付分配的商户号
+ 'device_info' => 'WEB',//终端设备号(门店号或收银设备ID),默认请传"WEB"
+ 'key' => 'oufcisdo3kld50dofdk545645dfloir3',//秘钥
+ 'token' => 'yunyoutong_wx_20170213',
+ 'SSLCERT_PATH' => __DIR__ . '/cert/1439003102/apiclient_cert.pem',//证书pem格式
+ 'SSLKEY_PATH' => __DIR__ . '/cert/1439003102/apiclient_key.pem',//证书密钥pem格式
+ ],
+ //蜘蛛分销微信配置
+ 'wx34e2f2b38cfb15a1' => [
+ 'appid' => 'wx34e2f2b38cfb15a1',//微信开放平台审核通过的应用APPID
+ 'appsecret' => 'eb60e17d2c86fd1c075abf1979edaedc',//secret
+ 'appName' => '蜘蛛分销',//名称
+ 'mch_id' => '1443331502',//微信支付分配的商户号
+ 'device_info' => 'WEB',//终端设备号(门店号或收银设备ID),默认请传"WEB"
+ 'key' => 'oufcisdo3kld50dofdk545645dfloir8',//秘钥
+ 'token' => 'zhizhufenxiao20170306',
+ 'SSLCERT_PATH' => __DIR__ . '/cert/1443331502/apiclient_cert.pem',//证书pem格式
+ 'SSLKEY_PATH' => __DIR__ . '/cert/1443331502/apiclient_key.pem',//证书密钥pem格式
+ ],
+ //千岛湖分销微信配置
+ 'wxf945d8fb99f6250d' => [
+ //web版微信支付
+ 'appid' => 'wxf945d8fb99f6250d',//微信开放平台审核通过的应用APPID
+ 'appsecret' => '9b18ba811a15eb336314a58cf4c3f650',//secret
+ 'appName' => '千岛湖',//名称
+ 'mch_id' => '1424400302',//微信支付分配的商户号
+ 'device_info' => 'WEB',//终端设备号(门店号或收银设备ID),默认请传"WEB"
+ 'key' => 'oufcisdo3kld50dofdk545645dfloire',//秘钥
+ 'token' => 'qdh_wx_20170103',
+ 'SSLCERT_PATH' => __DIR__ . '/cert/1424400302/apiclient_cert.pem',//证书pem格式
+ 'SSLKEY_PATH' => __DIR__ . '/cert/1424400302/apiclient_key.pem'//证书密钥pem格式
+ ],
+ //蜘蛛出行微信配置
+ 'wxbe6da4af3e529e0c' => [
+ //web版微信支付
+ 'appid' => 'wxbe6da4af3e529e0c',//微信开放平台审核通过的应用APPID
+ 'appName' => '蜘蛛出行',//名称
+ 'mch_id' => '1329733601',//微信支付分配的商户号
+ 'device_info' => 'WEB',//终端设备号(门店号或收银设备ID),默认请传"WEB"
+ 'key' => 'a6654d342eedd8e293692a3e211a5e53',//秘钥
+ 'token' => 'zzcx_wx_20160425',
+ 'appsecret' => '7c1b14020e87e9e213696e870da0e549',//secret
+ 'SSLCERT_PATH' => __DIR__ . '/cert/1329733601/apiclient_cert.pem',//证书pem格式
+ 'SSLKEY_PATH' => __DIR__ . '/cert/1329733601/apiclient_key.pem'//证书密钥pem格式
+ ],
+ //昆山微信配置
+ 'wx81ac156a5c166881' => [
+ //web版微信支付
+ 'appid' => 'wx81ac156a5c166881',//微信开放平台审核通过的应用APPID
+ 'appName' => '昆旅集散中心',//名称
+ 'mch_id' => '1503844711',//微信支付分配的商户号
+ 'device_info' => 'WEB',//终端设备号(门店号或收银设备ID),默认请传"WEB"
+ 'key' => 'sEr2ymgpy6VHijrj3bCAmhKiFXiXny4P',//秘钥
+ 'token'=> 'zzcx_wx_20160425',
+ 'appsecret' => 'f0c874a1f9cfed8c5a4a2ac024f4acf8',//secret
+ 'SSLCERT_PATH' => __DIR__ . '/cert/1503844711/apiclient_cert.pem',//证书pem格式
+ 'SSLKEY_PATH' => __DIR__ . '/cert/1503844711/apiclient_key.pem'//证书密钥pem格式
+ ],
+ //舟山微信配置
+ 'wx0376620fe134cef0' => [
+ //web版微信支付
+ 'appid' => 'wx0376620fe134cef0',//微信开放平台审核通过的应用APPID
+ 'appName' => '舟山群岛旅游服务中心',//名称
+ 'mch_id' => '1515696111',//微信支付分配的商户号
+ 'device_info' => 'WEB',//终端设备号(门店号或收银设备ID),默认请传"WEB"
+ 'key' => 'k3HVaO77fIBajgjdf69pRhXnkPCHxsHb',//秘钥
+ 'token'=> 'kslv_wx_2018058',
+ 'appsecret' => 'df92d376e296d85e676be45035aba285',//secret
+ 'SSLCERT_PATH' => __DIR__ . '/cert/1515696111/apiclient_cert.pem',//证书pem格式
+ 'SSLKEY_PATH' => __DIR__ . '/cert/1515696111/apiclient_key.pem'//证书密钥pem格式
+ ],
+ //快行微信配置
+ 'wxf5d1e7e3317bb073' => [
+ //web版微信支付
+ 'appid' => 'wxf5d1e7e3317bb073',//微信开放平台审核通过的应用APPID
+ 'appName' => '快行漫游',//名称
+ 'mch_id' => '1229862102',//微信支付分配的商户号
+ 'device_info' => 'WEB',//终端设备号(门店号或收银设备ID),默认请传"WEB"
+ 'key' => 'qaH3kBO22G32DBD5B12Dgg4GNg4N1Jxk',//秘钥
+ 'token'=> 'KXMYDYJ',
+ 'appsecret' => 'cec585fe804ede285f07a2f0093f2109',//secret
+ 'SSLCERT_PATH' => __DIR__ . '/cert/1229862102/apiclient_cert.pem',//证书pem格式
+ 'SSLKEY_PATH' => __DIR__ . '/cert/1229862102/apiclient_key.pem'//证书密钥pem格式
+ ]
+];
\ No newline at end of file
diff --git a/common/config/wechatConfig/wxInterface/1329733601/Wx.event.config.php b/common/config/wechatConfig/wxInterface/1329733601/Wx.event.config.php
new file mode 100644
index 0000000..4eefa0b
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1329733601/Wx.event.config.php
@@ -0,0 +1,30 @@
+ array(//用户关注
+ 'type' => 'news',//类型 图文
+ 'id' => 'AuXDjP791-NMcyJajUxBL0jmNmYMjTJ6fTQTEQV8Gh8',
+ 'function' => 'subscribe'//该推送消息出发时 会调用 addUser方法 方法存在于 WxDoFunction.php文件中
+ ),
+ 'unsubscribe' => array(//用户取消关注
+ 'function' => 'unsubscribe'//该推送消息出发时 会调用 addUser方法 方法存在于 WxDoFunction.php文件中
+ ),
+);
diff --git a/common/config/wechatConfig/wxInterface/1329733601/Wx.text.config.php b/common/config/wechatConfig/wxInterface/1329733601/Wx.text.config.php
new file mode 100644
index 0000000..41c4092
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1329733601/Wx.text.config.php
@@ -0,0 +1,40 @@
+ '您的问题已经光速飞向客服小通,请耐心等待我们的回复,谢谢~',
+ '视频' => array(//小视频
+ 'type' => 'video',//类型 视频
+ 'id' => 'FGV6tMS6FSixJwrxoMgyABc3P_bfmnEt8qUV3-J_M1s',//media_id
+ 'title' => '小视频',//标题
+ 'des' => '笑笑小视频'//简介
+ ),
+ '音乐' => array(
+ 'type' => 'voice',
+ 'id' => 'FGV6tMS6FSixJwrxoMgyAAitkX-PSTZ5LWDyPdlJuGg'
+ ),
+ '图片' => array(
+ 'type' => 'img',
+ 'id' => 'W1Po9FbHCDVcAZS-XYBWuJxBKRG2FbvqetpfRVw9E98'
+ ),
+ '客服' => '客服热线:025-85477639',
+
+
+);
\ No newline at end of file
diff --git a/common/config/wechatConfig/wxInterface/1329733601/wxMenu.config.php b/common/config/wechatConfig/wxInterface/1329733601/wxMenu.config.php
new file mode 100644
index 0000000..42fa273
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1329733601/wxMenu.config.php
@@ -0,0 +1,51 @@
+ array(//用户关注
+ 'text' => '亲,感谢您对千岛湖旅游集散中心的支持,点击预订即可订购产品,如有问题请第一时间联系我们!官方电话400-105-1078',
+// 'function' => 'subscribe'//该推送消息出发时 会调用 addUser方法 方法存在于 WxDoFunction.php文件中
+ ),
+// 'unsubscribe' => array(//用户取消关注
+// 'function' => 'unsubscribe'//该推送消息出发时
+// ),
+// 'contact_customer' => '亲,我们的电话是025-85477639,随时等候您的来电,非工作时间如客服电话无人接听,欢迎您在公众号留言,我们将在上班后第一时间与您联系。',
+);
diff --git a/common/config/wechatConfig/wxInterface/1424400302/Wx.text.config.php b/common/config/wechatConfig/wxInterface/1424400302/Wx.text.config.php
new file mode 100644
index 0000000..8546530
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1424400302/Wx.text.config.php
@@ -0,0 +1,60 @@
+ '亲,感谢您对千岛湖旅游集散中心的支持,点击预订即可订购产品,如有问题请第一时间联系我们!官方电话400-105-1078',
+ '视频' => array(//小视频
+ 'type' => 'video',//类型 视频
+ 'id' => 'FGV6tMS6FSixJwrxoMgyABc3P_bfmnEt8qUV3-J_M1s',//media_id
+ 'title' => '小视频',//标题
+ 'des' => '笑笑小视频'//简介
+ ),
+ '音乐' => array(
+ 'type' => 'voice',
+ 'id' => 'FGV6tMS6FSixJwrxoMgyAAitkX-PSTZ5LWDyPdlJuGg'
+ ),
+ '图片' => array(
+ 'type' => 'img',
+ 'id' => 'W1Po9FbHCDVcAZS-XYBWuJxBKRG2FbvqetpfRVw9E98'
+ ),
+ '客服' => '客服热线:021-52218088',
+ 'test' => array(
+ 'text' => '蜘蛛分销测试fx.zhizhuchuxing.cn
+
+出行预订
+
+ 二维码
+
+ 我的佣金
+
+ C端出行预订
+
+千岛湖分销分销测试qdhfx.zhizhuchuxing.cn
+
+出行预订
+
+ 二维码
+
+ 我的佣金
+
+ C端出行预订
+',
+ )
+);
diff --git a/common/config/wechatConfig/wxInterface/1424400302/wxMenu.config.php b/common/config/wechatConfig/wxInterface/1424400302/wxMenu.config.php
new file mode 100644
index 0000000..8ff6707
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1424400302/wxMenu.config.php
@@ -0,0 +1,32 @@
+ array(//用户关注
+ 'text' => '亲,感谢您对蜘蛛分销的支持,点击预订即可帮助客户订购产品,有问题请第一时间联系我们!',
+// 'function' => 'subscribe'//该推送消息出发时 会调用 addUser方法 方法存在于 WxDoFunction.php文件中
+ ),
+// 'unsubscribe' => array(//用户取消关注
+// 'function' => 'unsubscribe'//该推送消息出发时
+// ),
+// 'contact_customer' => '亲,我们的电话是025-85477639,随时等候您的来电,非工作时间如客服电话无人接听,欢迎您在公众号留言,我们将在上班后第一时间与您联系。',
+);
diff --git a/common/config/wechatConfig/wxInterface/1439003102/Wx.text.config.php b/common/config/wechatConfig/wxInterface/1439003102/Wx.text.config.php
new file mode 100644
index 0000000..9ff2cd6
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1439003102/Wx.text.config.php
@@ -0,0 +1,60 @@
+ '您的问题已经光速飞向客服,请耐心等待我们的回复,谢谢~',
+ '视频' => array(//小视频
+ 'type' => 'video',//类型 视频
+ 'id' => 'FGV6tMS6FSixJwrxoMgyABc3P_bfmnEt8qUV3-J_M1s',//media_id
+ 'title' => '小视频',//标题
+ 'des' => '笑笑小视频'//简介
+ ),
+ '音乐' => array(
+ 'type' => 'voice',
+ 'id' => 'FGV6tMS6FSixJwrxoMgyAAitkX-PSTZ5LWDyPdlJuGg'
+ ),
+ '图片' => array(
+ 'type' => 'img',
+ 'id' => 'W1Po9FbHCDVcAZS-XYBWuJxBKRG2FbvqetpfRVw9E98'
+ ),
+ '客服' => '客服热线:021-52218088',
+ 'test' => array(
+ 'text' => '蜘蛛分销测试fx.zhizhuchuxing.cn
+
+出行预订
+
+ 二维码
+
+ 我的佣金
+
+ C端出行预订
+
+千岛湖分销分销测试qdhfx.zhizhuchuxing.cn
+
+出行预订
+
+ 二维码
+
+ 我的佣金
+
+ C端出行预订
+',
+ )
+);
diff --git a/common/config/wechatConfig/wxInterface/1439003102/wxMenu.config.php b/common/config/wechatConfig/wxInterface/1439003102/wxMenu.config.php
new file mode 100644
index 0000000..4e411b8
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1439003102/wxMenu.config.php
@@ -0,0 +1,32 @@
+ array(//用户关注
+ 'text' => '亲,感谢您对蜘蛛分销的支持,点击预订即可帮助客户订购产品,有问题请第一时间联系我们!',
+// 'function' => 'subscribe'//该推送消息出发时 会调用 addUser方法 方法存在于 WxDoFunction.php文件中
+ ),
+// 'unsubscribe' => array(//用户取消关注
+// 'function' => 'unsubscribe'//该推送消息出发时
+// ),
+// 'contact_customer' => '亲,我们的电话是025-85477639,随时等候您的来电,非工作时间如客服电话无人接听,欢迎您在公众号留言,我们将在上班后第一时间与您联系。',
+);
diff --git a/common/config/wechatConfig/wxInterface/1443331502/Wx.text.config.php b/common/config/wechatConfig/wxInterface/1443331502/Wx.text.config.php
new file mode 100644
index 0000000..9ff2cd6
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1443331502/Wx.text.config.php
@@ -0,0 +1,60 @@
+ '您的问题已经光速飞向客服,请耐心等待我们的回复,谢谢~',
+ '视频' => array(//小视频
+ 'type' => 'video',//类型 视频
+ 'id' => 'FGV6tMS6FSixJwrxoMgyABc3P_bfmnEt8qUV3-J_M1s',//media_id
+ 'title' => '小视频',//标题
+ 'des' => '笑笑小视频'//简介
+ ),
+ '音乐' => array(
+ 'type' => 'voice',
+ 'id' => 'FGV6tMS6FSixJwrxoMgyAAitkX-PSTZ5LWDyPdlJuGg'
+ ),
+ '图片' => array(
+ 'type' => 'img',
+ 'id' => 'W1Po9FbHCDVcAZS-XYBWuJxBKRG2FbvqetpfRVw9E98'
+ ),
+ '客服' => '客服热线:021-52218088',
+ 'test' => array(
+ 'text' => '蜘蛛分销测试fx.zhizhuchuxing.cn
+
+出行预订
+
+ 二维码
+
+ 我的佣金
+
+ C端出行预订
+
+千岛湖分销分销测试qdhfx.zhizhuchuxing.cn
+
+出行预订
+
+ 二维码
+
+ 我的佣金
+
+ C端出行预订
+',
+ )
+);
diff --git a/common/config/wechatConfig/wxInterface/1443331502/wxMenu.config.php b/common/config/wechatConfig/wxInterface/1443331502/wxMenu.config.php
new file mode 100644
index 0000000..2272323
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1443331502/wxMenu.config.php
@@ -0,0 +1,32 @@
+ array(//用户关注
+ 'text' => '亲,感谢您对蜘蛛分销的支持,点击预订即可帮助客户订购产品,有问题请第一时间联系我们!',
+// 'function' => 'subscribe'//该推送消息出发时 会调用 addUser方法 方法存在于 WxDoFunction.php文件中
+ ),
+// 'unsubscribe' => array(//用户取消关注
+// 'function' => 'unsubscribe'//该推送消息出发时
+// ),
+// 'contact_customer' => '亲,我们的电话是025-85477639,随时等候您的来电,非工作时间如客服电话无人接听,欢迎您在公众号留言,我们将在上班后第一时间与您联系。',
+);
diff --git a/common/config/wechatConfig/wxInterface/1503844711/Wx.text.config.php b/common/config/wechatConfig/wxInterface/1503844711/Wx.text.config.php
new file mode 100644
index 0000000..9ff2cd6
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1503844711/Wx.text.config.php
@@ -0,0 +1,60 @@
+ '您的问题已经光速飞向客服,请耐心等待我们的回复,谢谢~',
+ '视频' => array(//小视频
+ 'type' => 'video',//类型 视频
+ 'id' => 'FGV6tMS6FSixJwrxoMgyABc3P_bfmnEt8qUV3-J_M1s',//media_id
+ 'title' => '小视频',//标题
+ 'des' => '笑笑小视频'//简介
+ ),
+ '音乐' => array(
+ 'type' => 'voice',
+ 'id' => 'FGV6tMS6FSixJwrxoMgyAAitkX-PSTZ5LWDyPdlJuGg'
+ ),
+ '图片' => array(
+ 'type' => 'img',
+ 'id' => 'W1Po9FbHCDVcAZS-XYBWuJxBKRG2FbvqetpfRVw9E98'
+ ),
+ '客服' => '客服热线:021-52218088',
+ 'test' => array(
+ 'text' => '蜘蛛分销测试fx.zhizhuchuxing.cn
+
+出行预订
+
+ 二维码
+
+ 我的佣金
+
+ C端出行预订
+
+千岛湖分销分销测试qdhfx.zhizhuchuxing.cn
+
+出行预订
+
+ 二维码
+
+ 我的佣金
+
+ C端出行预订
+',
+ )
+);
diff --git a/common/config/wechatConfig/wxInterface/1503844711/wxMenu.config.php b/common/config/wechatConfig/wxInterface/1503844711/wxMenu.config.php
new file mode 100644
index 0000000..2272323
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1503844711/wxMenu.config.php
@@ -0,0 +1,32 @@
+ array(//用户关注
+ 'text' => '亲,感谢您对蜘蛛分销的支持,点击预订即可帮助客户订购产品,有问题请第一时间联系我们!',
+// 'function' => 'subscribe'//该推送消息出发时 会调用 addUser方法 方法存在于 WxDoFunction.php文件中
+ ),
+// 'unsubscribe' => array(//用户取消关注
+// 'function' => 'unsubscribe'//该推送消息出发时
+// ),
+// 'contact_customer' => '亲,我们的电话是025-85477639,随时等候您的来电,非工作时间如客服电话无人接听,欢迎您在公众号留言,我们将在上班后第一时间与您联系。',
+);
diff --git a/common/config/wechatConfig/wxInterface/1515696111/Wx.text.config.php b/common/config/wechatConfig/wxInterface/1515696111/Wx.text.config.php
new file mode 100644
index 0000000..9ff2cd6
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1515696111/Wx.text.config.php
@@ -0,0 +1,60 @@
+ '您的问题已经光速飞向客服,请耐心等待我们的回复,谢谢~',
+ '视频' => array(//小视频
+ 'type' => 'video',//类型 视频
+ 'id' => 'FGV6tMS6FSixJwrxoMgyABc3P_bfmnEt8qUV3-J_M1s',//media_id
+ 'title' => '小视频',//标题
+ 'des' => '笑笑小视频'//简介
+ ),
+ '音乐' => array(
+ 'type' => 'voice',
+ 'id' => 'FGV6tMS6FSixJwrxoMgyAAitkX-PSTZ5LWDyPdlJuGg'
+ ),
+ '图片' => array(
+ 'type' => 'img',
+ 'id' => 'W1Po9FbHCDVcAZS-XYBWuJxBKRG2FbvqetpfRVw9E98'
+ ),
+ '客服' => '客服热线:021-52218088',
+ 'test' => array(
+ 'text' => '蜘蛛分销测试fx.zhizhuchuxing.cn
+
+出行预订
+
+ 二维码
+
+ 我的佣金
+
+ C端出行预订
+
+千岛湖分销分销测试qdhfx.zhizhuchuxing.cn
+
+出行预订
+
+ 二维码
+
+ 我的佣金
+
+ C端出行预订
+',
+ )
+);
diff --git a/common/config/wechatConfig/wxInterface/1515696111/wxMenu.config.php b/common/config/wechatConfig/wxInterface/1515696111/wxMenu.config.php
new file mode 100644
index 0000000..2272323
--- /dev/null
+++ b/common/config/wechatConfig/wxInterface/1515696111/wxMenu.config.php
@@ -0,0 +1,32 @@
+ 255],
+ [['update_user'], 'string', 'max' => 50],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'category_id' => 'Category ID',
+ 'category_name' => 'Category Name',
+ 'parent_id' => 'Parent ID',
+ 'delete_flag' => 'Delete Flag',
+ 'create_time' => 'Create Time',
+ 'update_time' => 'Update Time',
+ 'update_user' => 'Update User',
+ ];
+ }
+
+ /**
+ * Function Description:获取基础数组信息
+ * Function Name: getTypeArr
+ *
+ * @return array|\yii\db\ActiveRecord[]
+ *
+ * @author 娄梦宁
+ */
+ public function getTypeArr(){
+ $result=$this::find()->select(['category_id','category_name'])
+ ->from(self::tableName())
+ ->where(['=','delete_flag',0])
+ ->asArray()
+ ->all();
+ return $result;
+ }
+
+ /**
+ * Des:获取
+ * Name: getAllList
+ * @return array|\yii\db\ActiveRecord[]
+ * @author 倪宗锋
+ */
+ public function getAllList()
+ {
+ $result = self::find()
+ ->from(self::tableName())
+ ->asArray()
+ ->all();
+ return $result;
+ }
+
+ /**
+ * Des:获取页面展示的订单类型
+ * Name: getShowList
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getShowList()
+ {
+ $result = self::find()->select(['category_id as order_type_id','category_name as order_type_des'])
+ ->from(self::tableName())
+ ->asArray()
+ ->all();
+ return $result;
+ }
+}
diff --git a/common/models/BusTicket.php b/common/models/BusTicket.php
new file mode 100644
index 0000000..db33617
--- /dev/null
+++ b/common/models/BusTicket.php
@@ -0,0 +1,305 @@
+ 50],
+ [['line_name'], 'string', 'max' => 255],
+ [['ticket_id'], 'unique'],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'ticket_id' => 'Ticket ID',
+ 'start_area_id' => 'Start Area ID',
+ 'start_area_name' => 'Start Area Name',
+ 'end_area_id' => 'End Area ID',
+ 'end_area_name' => 'End Area Name',
+ 'start_res_id' => 'Start Res ID',
+ 'start_res_name' => 'Start Res Name',
+ 'end_res_id' => 'End Res ID',
+ 'end_res_name' => 'End Res Name',
+ 'line_id' => 'Line ID',
+ 'line_type' => 'Line Type',
+ 'prod_price' => 'Prod Price',
+ 'line_name' => 'Line Name',
+ 'start_LONGITUDE' => 'start_LONGITUDE',
+ 'start_LATITUDE' => 'start_LATITUDE',
+ 'end_LONGITUDE' => 'end_LONGITUDE',
+ 'end_LATITUDE' => 'end_LATITUDE'
+ ];
+ }
+
+ public function insertBus($ticket_arr)
+ {
+ foreach ($ticket_arr as $val) {
+ $this->isNewRecord = true;
+ $this->setAttributes($val);
+ $this->save();
+ }
+ }
+
+ /**
+ * Function Description:新增可售票种的操作
+ * Function Name: istBusTicket
+ * @param $ticket_arr
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function istBusTicket($ticket_arr)
+ {
+ $prod_category_1 = new ProdCategory();
+ $prod_main_1 = new ProdMain();
+
+ foreach ($ticket_arr as $val) {
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+ //***************************************插入bus_ticket表**************************************************
+ $this->isNewRecord = true;
+ $this->setAttributes($val);
+ $res = $this->save();
+ if ($res === false) {
+ $transaction->rollBack();
+ continue;
+ }
+ //***************************************插入prod_category表**************************************************
+ $tmp_pro_name = $val['line_name'] . "({$val['start_res_name']}-{$val['end_res_name']})";
+ $value = [
+ 'category_id' => '1',
+ 'pro_cate_name' => $tmp_pro_name,
+ 'bus_ticket_id' => $val['ticket_id'],
+ 'bus_line_type' => $val['line_type'],
+ 'create_time' => date('Y-m-d H:i:s'),
+ 'show_price' => $val['prod_price'],
+ 'commission' => 5,
+ ];
+ $prod_category = clone $prod_category_1;
+ $prod_category->attributes = $value;
+ $prod_res = $prod_category->insert();
+ if ($prod_res === false) {
+ $transaction->rollBack();
+ continue;
+ }
+ //***************************************插入prod_main表**************************************************
+ $value_adult = [
+ 'prod_cate_id' => $prod_category->pro_cate_id,
+ 'prod_price' => $val['prod_price'],
+ 'bus_id' => $val['ticket_id'],
+ 'prod_name' => '成人票',
+ 'create_time' => date('Y-m-d H:i:s')
+ ];
+ $prod_main = clone $prod_main_1;
+ $prod_main->attributes = $value_adult;
+ $prod_main_res = $prod_main->insert();
+ if ($prod_main_res === false) {
+ $transaction->rollBack();
+ continue;
+ }
+ $value_child = [
+ 'prod_cate_id' => $prod_category->pro_cate_id,
+ 'prod_price' => $val['prod_price'],
+ 'bus_id' => $val['ticket_id'],
+ 'prod_name' => '儿童票',
+ 'create_time' => date('Y-m-d H:i:s')
+ ];
+ $prod_main_2 = clone $prod_main_1;
+ $prod_main_2->attributes = $value_child;
+ $prod_main_res_2 = $prod_main_2->insert();
+ if ($prod_main_res_2 === false) {
+ $transaction->rollBack();
+ continue;
+ }
+ $transaction->commit();
+ } catch (Exception $e) {
+ $transaction->rollBack();
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Function Description:cs系统取消的票种处理
+ * Function Name: delBusTicket
+ * @param $ticket_arr
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function delBusTicket($ticket_arr)
+ {
+
+ $prod_category = new ProdCategory();
+ $prod_main = new ProdMain();
+ foreach ($ticket_arr as $val) {
+ $transaction = Yii::$app->db->beginTransaction();
+ //物理删除bus_ticket表
+ $this->deleteAll(['ticket_id' => $val['ticket_id']]);
+ //***************************************改变prod_category表状态位**************************************************
+ $count = $prod_category::updateAll(['delete_flag' => 1], ['=', 'bus_ticket_id', $val['ticket_id']]);
+ if (!$count) {
+ $transaction->rollBack();
+ continue;
+ }
+ //***************************************改变prod_main表状态位**************************************************
+ $count = $prod_main::updateAll(['delete_flag' => 1], ['=', 'bus_id', $val['ticket_id']]);
+ if (!$count) {
+ $transaction->rollBack();
+ continue;
+ }
+ $transaction->commit();
+ }
+
+ return true;
+ }
+
+
+ /**
+ * Des:激活已售卖的产品
+ * Name: assocBusTicket
+ * @param $ticket_arr
+ * @return bool
+ * @throws \yii\db\Exception
+ * @author 倪宗锋
+ */
+ public function assocBusTicket($ticket_arr)
+ {
+ $transaction = Yii::$app->db->beginTransaction();
+ $prod_category = new ProdCategory();
+ foreach ($ticket_arr as $val) {
+ //***************************************修改bus_ticket表现有记录**************************************************
+ self::updateAll($val, ['=', 'ticket_id', $val['ticket_id']]);
+ //***************************************改变prod_category表状态位**************************************************
+ $prod_category::updateAll(['delete_flag' => 0], ['=', 'bus_ticket_id', $val['ticket_id']]);//不论是否成功
+ }
+ $transaction->commit();
+ return true;
+
+ }
+
+ /**
+ * Function Description:查返程票种id对应的产品id
+ * Function Name: getBackTicketId
+ * @param $ticket_id
+ *
+ * @return mixed
+ *
+ * @author 娄梦宁
+ */
+ public function getBackTicketId($ticket_id)
+ {
+ $result = self::find()->select(['c.pro_cate_id'])
+ ->from(self::tableName() . ' as a')
+ ->innerJoin('bus_ticket b', 'a.end_res_name=b.start_res_name and a.start_res_name=b.end_res_name')
+ ->innerJoin('prod_category c', 'a.ticket_id=c.bus_ticket_id')
+ ->where(['b.ticket_id' => $ticket_id])
+ ->orderBy('a.ticket_id desc,c.pro_cate_id desc')
+ ->asArray()
+ ->one();
+ return $result['pro_cate_id'];
+ }
+
+
+ /*
+ * 获取当前数据库所存票种信息
+ */
+ public function getBusArr()
+ {
+ $result = self::find()
+ ->from(self::tableName())
+ ->indexBy('ticket_id')
+ ->asArray()
+ ->all();
+ return $result;
+ }
+
+ /**
+ * Des:
+ * Name: getTicketAndLineByIDs
+ * @param $ticketIds array
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getTicketAndLineByIDs($ticketIds)
+ {
+ $where = [
+ 'and',
+ ['in', 'ticket_id', $ticketIds],
+ ['=', 'b.delete_flag', 0]
+ ];
+ $result = self::find()->select(['a.start_res_name', 'a.start_res_id', new Expression("GROUP_CONCAT(CONCAT(ticket_id,'|',a.end_res_id,'|',a.end_res_name,'|',b.pro_cate_id) separator '||') FxTicket")])
+ ->from(self::tableName() . ' as a')
+ ->innerJoin(ProdCategory::tableName() . ' b', 'a.ticket_id = b.bus_ticket_id')
+ ->where($where)
+ ->groupBy('a.start_res_id')
+ ->indexBy('start_res_id')
+ ->asArray()
+ ->all();
+ if (empty($result)) {
+ return [];
+ }
+ foreach ($result as $key => $val) {//拼接成以起始站为中心的数组
+ $result[$key]['end_station_list'] = [];
+ $ticketArr = explode('||', $val['FxTicket']);
+ foreach ($ticketArr as $val1) {
+ $theArr = explode('|', $val1);
+ if (count($theArr) == 4) {
+ $theArr1['ticket_id'] = $theArr[0];
+ $theArr1['end_res_id'] = $theArr[1];
+ $theArr1['end_res_name'] = $theArr[2];
+ $theArr1['pro_cate_id'] = $theArr[3];
+ $result[$key]['end_station_list'][$theArr[0]] = $theArr1;
+ }
+ }
+ unset($result[$key]['FxTicket']);
+ }
+ return $result;
+ }
+}
diff --git a/common/models/CmsCategory.php b/common/models/CmsCategory.php
new file mode 100644
index 0000000..2f800be
--- /dev/null
+++ b/common/models/CmsCategory.php
@@ -0,0 +1,121 @@
+ 50],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'cms_category_id' => 'Cms Category ID',
+ 'category_name' => 'Category Name',
+ 'show_sort' => 'Show Sort',
+ 'delete_flag' => 'Delete Flag',
+ 'create_time' => 'Create Time',
+ 'update_time' => 'Update Time',
+ 'update_user' => 'Update User',
+ ];
+ }
+ /**
+ * Function Description:cms添加产品信息
+ * Function Name: addCmsProd
+ * @param $param
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function addCmsProd($param){
+ $transaction=Yii::$app->db->beginTransaction();
+ if($param['cms_category_id']==0){
+ //新增栏目
+ $connection=Yii::$app->db;
+ $istCount=$connection->createCommand()->insert('cms_category', [
+ 'update_user' => AdminUtil::$uid,
+ 'show_sort' => 6,
+ 'category_name'=>$param['cms_category_name'],
+ 'create_time'=>date('Y-m-d H:i:s')
+ ])->execute();
+ if($istCount!=1){
+ $transaction->rollBack();
+ return false;
+ }
+ };
+ $values=[
+ 'cms_cate_id'=>$param['cms_category_id']==0 ? $connection->getLastInsertID() : $param['cms_category_id'],
+ 'prod_cate_id'=>$param['prod_cate_id'],
+ 'create_time'=>date('Y-m-d H:i:s'),
+ 'show_sort'=>1
+ ];
+ $cms_category_prod=new CmsCategoryProd();
+ $cms_category_prod->attributes=$values;
+ $res=$cms_category_prod->insert();
+ if(!$res){
+ $transaction->rollBack();
+ return false;
+ }
+ $transaction->commit();
+ return true;
+ }
+ /**
+ * Function Description:大类型查询
+ * Function Name: getCategoryArr
+ *
+ * @return array|\yii\db\ActiveRecord[]
+ *
+ * @author 娄梦宁
+ */
+ public function getCategoryArr(){
+ $system = Yii::$app->params['system'];
+ $where = [
+ 'and',
+ ['=', 'system', $system],
+ ['=', 'delete_flag', 0]
+ ];
+ $result=self::find()->select(['cms_category_id','category_name'])
+ ->from(self::tableName())
+ ->where($where)
+ ->orderBy('show_sort desc')
+ ->asArray()
+ ->all();
+ return $result;
+ }
+}
diff --git a/common/models/CmsCategoryProd.php b/common/models/CmsCategoryProd.php
new file mode 100644
index 0000000..e6ba38e
--- /dev/null
+++ b/common/models/CmsCategoryProd.php
@@ -0,0 +1,157 @@
+ 50],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'prod_cate_id' => 'Prod Cate ID',
+ 'cms_cate_id' => 'Cms Cate ID',
+ 'show_sort' => 'Show Sort',
+ 'delete_flag' => 'Delete Flag',
+ 'create_time' => 'Create Time',
+ 'update_time' => 'Update Time',
+ 'update_user' => 'Update User',
+ ];
+ }
+
+ /**
+ * Function Description:修改产品与左侧菜单绑定关系
+ * Function Name: uptCmsAdmin
+ * @param $param
+ *
+ * @return bool|int
+ *
+ * @author 娄梦宁
+ */
+ public function uptCmsAdmin($param){
+ $transaction = Yii::$app->db->beginTransaction();
+ if($param['cms_category_id']==-1){
+ //产品下架
+ $res=$this->deleteAll(['=','prod_cate_id',$param['pro_cate_id']]);
+ if($res===false){
+ $transaction->rollBack();
+ return false;
+ }
+ }elseif($param['cms_category_id']==0){
+ //新增左侧菜单
+ $connection=Yii::$app->db;
+ $istCount=$connection->createCommand()->insert('cms_category', [
+ 'category_name'=>$param['cms_category_name'],
+ 'create_time'=>date('Y-m-s H:i:s'),
+ 'show_sort'=>6,
+ 'update_user'=>1
+ ])->execute();
+ if($istCount!=1){
+ $transaction->rollBack();
+ return false;
+ };
+ $id=Yii::$app->db->getLastInsertID();
+ $istCount=$connection->createCommand()->insert('cms_category_prod', [
+ 'update_user' => AdminUtil::$uid,
+ 'show_sort' => 1000,
+ 'cms_cate_id'=>$id,
+ 'create_time'=>date('Y-m-d H:i:s'),
+ 'prod_cate_id'=>(int)$param['pro_cate_id'],
+ ])->execute();
+ if($istCount!=1){
+ $transaction->rollBack();
+ return false;
+ }
+// $cms_category=new CmsCategory();
+// $value=[
+// 'category_name'=>$param['cms_category_name'],
+// 'create_time'=>date('Y-m-s H:i:s'),
+// 'show_sort'=>6,
+// 'update_user'=>1
+// ];
+// $cms_category->attributes=$value;
+// $res=$cms_category->insert();
+// if(!$res){
+// $transaction->rollBack();
+// return false;
+// }
+ }else{
+ //修改产品所属菜单
+ $prod_cate_id=self::find()->select(['count(1) as cnt'])->from(self::tableName())->where(['prod_cate_id'=>$param['pro_cate_id']])->asArray()->one();
+ if($prod_cate_id['cnt']!=0){//有则修改
+ $count = self::updateAll(['cms_cate_id'=>$param['cms_category_id'],'update_user'=>AdminUtil::$uid], ['and',['=','prod_cate_id',$param['pro_cate_id']],['=','delete_flag',0]]);
+ if($count===false){
+ return false;
+ };
+ }else{//没有则新增
+ $connection=Yii::$app->db;
+ $istCount=$connection->createCommand()->insert('cms_category_prod', [
+ 'update_user' => AdminUtil::$uid,
+ 'show_sort' => 1000,
+ 'cms_cate_id'=>(int)$param['cms_category_id'],
+ 'create_time'=>date('Y-m-d H:i:s'),
+ 'prod_cate_id'=>(int)$param['pro_cate_id'],
+ ])->execute();
+ if($istCount!=1){
+ $transaction->rollBack();
+ return false;
+ }
+// $values=[
+// 'prod_cate_id'=>(int)$param['pro_cate_id'],
+// 'cms_cate_id'=>(int)$param['cms_category_id'],
+// 'show_sort'=>1000,
+// 'create_time'=>date('Y-m-d H:i:s'),
+// 'update_user'=>AdminUtil::$uid
+// ];
+// $this->attributes=$values;
+// $res=$this->insert();
+// if(!$res){
+// throw new Exception('添加出错');
+// return false;
+// }
+ }
+ }
+ $transaction->commit();
+ return true;
+ }
+
+}
diff --git a/common/models/FxCommissionApply.php b/common/models/FxCommissionApply.php
new file mode 100644
index 0000000..1012705
--- /dev/null
+++ b/common/models/FxCommissionApply.php
@@ -0,0 +1,190 @@
+ 50],
+ [['auth_memo'], 'string', 'max' => 255],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'fx_uid' => 'Fx Uid',
+ 'apply_money' => 'Apply Money',
+ 'status' => 'Status',
+ 'remit_time' => 'Remit Time',
+ 'auth_time' => 'Auth Time',
+ 'auth_memo' => 'Auth Memo',
+ 'auth_uid' => 'Auth Uid',
+ 'remit_uid' => 'Remit Uid',
+ 'delete_flag' => 'Delete Flag',
+ 'create_time' => 'Create Time',
+ 'update_time' => 'Update Time',
+ 'update_user' => 'Update User',
+ ];
+ }
+
+ /**
+ * Function Description:提现明细
+ * Function Name: getCommissionApplyList
+ *
+ * @return array|\yii\db\ActiveRecord[]
+ *
+ * @author 娄梦宁
+ */
+ public function getCommissionApplyList(){
+ $fx_uid=FxUtil::$uid;
+ $result=self::find()->select(['apply_money','status','date_format(create_time,"%m-%d %H:%i:%s") as create_date',"if(`status`=1,'未审核','已审核') as status_desc"])
+ ->from(self::tableName())
+ ->where(['and',['=','fx_uid',$fx_uid],['=','delete_flag',0]])
+ ->asArray()
+ ->all();
+ return $result;
+ }
+
+ /**
+ * Function Description:提交提现申请,申请表记录
+ * Function Name: InsertApplyCommission
+ * @param $apply_commission
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function InsertApplyCommission($apply_commission){
+ $values=[
+ 'status'=>1,
+ 'apply_money'=>$apply_commission,
+ 'fx_uid'=>FxUtil::$uid,
+ 'create_time'=>date('Y-m-d H:i:s'),
+ ];
+ $transaction=Yii::$app->db->beginTransaction();
+ try{
+ $this->attributes=$values;
+ $res=$this->insert();
+ if(!$res){
+ throw new Exception('添加出错');
+ }
+ $transaction->commit();
+ return true;
+ }catch (Exception $e){
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+ /**
+ * Function Description:后台提现列表
+ * Function Name: ApplyList
+ * @param $param
+ *
+ * @return array
+ *
+ * @author 娄梦宁
+ */
+ public function ApplyList($param){
+ $where=['and',['=','a.delete_flag',0]];
+ if ($param['apply_user_name'] != '') {
+ $where[] = ['like', 'b.nickname', $param['apply_user_name']];
+ }
+ if ($param['apply_user_phone'] != '') {
+ $where[] = ['like', 'b.phone', $param['apply_user_phone']];
+ }
+ if ($param['start_time'] != '') {
+ $where[] = ['>=', 'a.create_time', $param['start_time']];
+ }
+ if ($param['end_time'] != '') {
+ $where[] = ['<', 'a.create_time', date('Y-m-d',strtotime("{$param['end_time']} +1 day"))];
+ }
+ if ($param['apply_status'] != '') {
+ $where[] = ['=', 'a.status', $param['apply_status']];
+ }
+ $select=[
+ 'b.nickname as apply_user_name',
+ 'b.phone as apply_user_phone',
+ 'a.apply_money',
+ 'b.openid open_id',
+ 'b.wx_openid',
+ '(select "微信") as apply_style_des',
+ 'a.status as apply_status_id',
+ new Expression("CASE a.status
+ WHEN 1 THEN '待处理'
+ WHEN 2 THEN '已审核'
+ ELSE ''
+ END
+ as apply_status_des
+ "),
+ 'a.create_time apply_create_time',
+ 'a.id as apply_id'
+ ];
+ $offset = ($param['current_page'] - 1) * $param['page_size'];
+ $result=self::find()->select($select)
+ ->from(self::tableName().' as a')
+ ->leftJoin('fx_user as b','a.fx_uid=b.uid')
+ ->where($where)
+ ->orderBy('a.create_time desc')
+ ->offset($offset)
+ ->limit($param['page_size'])
+ ->asArray()
+ ->all();
+ $count=self::find()->select('count(1) as count')->from(self::tableName().' as a')->leftJoin('fx_user as b','a.fx_uid=b.uid')->where($where)->asArray()->one();
+ $count=$count['count'] ;
+ return ['list'=>$result,'count'=>$count];
+ }
+
+ /*
+ * 提现通过,状态变更
+ */
+ public function applyChange($apply_id){
+ $count = self::updateAll(['status'=>2,'update_user'=>AdminUtil::$uid,'auth_time'=>date('Y-m-d H:i:s')], ['and', ['=', 'status', 1], ['=', 'id', $apply_id]]);
+ return $count;
+ }
+}
diff --git a/common/models/FxCommissionInfo.php b/common/models/FxCommissionInfo.php
new file mode 100644
index 0000000..386cc75
--- /dev/null
+++ b/common/models/FxCommissionInfo.php
@@ -0,0 +1,159 @@
+ 50],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'fx_uid' => 'Fx Uid',
+ 'total_money' => 'Total Money',
+ 'order_id' => 'Order ID',
+ 'status' => 'Status',
+ 'delete_flag' => 'Delete Flag',
+ 'create_time' => 'Create Time',
+ 'update_time' => 'Update Time',
+ 'update_user' => 'Update User',
+ ];
+ }
+
+ public function finishCommission()
+ {
+ $cnt = 0;
+ $count = 0;
+ //1.找出今天-完成日期大于3天的订单号,且佣金待结算
+ $LogOrder = self::find()->select(['GROUP_CONCAT(a.order_id) as order_arr'])
+ ->from('order_main as a')
+ ->leftJoin('fx_commission_info as b', 'a.order_id=b.order_id')
+ ->where(['and', ['=', 'order_status', 3], ['>', 'DATEDIFF(current_date,end_date)', 2], ['=', 'a.delete_flag', 0], ['=', 'b.`status`', 1]])
+ ->asArray()
+ ->all();
+ $uptOrder = explode(',', $LogOrder[0]['order_arr']);
+ if (empty($uptOrder['0']) == false) {
+ //2.佣金表待结算变已结算
+ $count = self::updateAll(['status' => 2], ['and', ['=', 'status', 1], ['in', 'order_id', $uptOrder]]);
+ //3.不同用户的账户表分别更新
+ //查出需要更新的分销账户及佣金金额
+ $fx_user = self::find()->select(['fx_uid', 'SUM(total_money) as money'])
+ ->from(self::tableName())
+ ->where(['and', ['in', 'order_id', $uptOrder], ['=', 'delete_flag', 0]])
+ ->groupBy('fx_uid')
+ ->asArray()
+ ->all();
+ if (count($fx_user) != 0) {
+ $fx_user_account = new FxUserAccount();
+ foreach ($fx_user as $val) {
+ $available_commission = $val['money'];
+ $fx_uid = $val['fx_uid'];
+ $array = ['available_commission' => new Expression("available_commission +$available_commission"), 'total_commission' => new Expression("total_commission +$available_commission")];
+ $cnt += $fx_user_account::updateAll($array, ['and', ['=', 'fx_uid', $fx_uid]]);
+ }
+ }
+ foreach ($uptOrder as $val) {
+ Util::interfaceZzcx(['type' => 3, 'order_id' => $val], '/zzcx/interfaces/order/send-wx-msg', 1);
+ }
+ Util::addOrderLog(0, 0, implode('-', $uptOrder), '佣金结算', 7);
+
+ }
+ return ['order_list' => $LogOrder[0]['order_arr'], 'count' => $count, 'cnt' => $cnt];
+ }
+
+ /**
+ * Function Description:佣金明细
+ * Function Name: getInfoAdmin
+ * @param $order_id
+ *
+ * @return array|\yii\db\ActiveRecord[]
+ *
+ * @author 娄梦宁
+ */
+ public function getInfoAdmin($order_id)
+ {
+ $result = self::find()
+ ->from('order_info a')
+ ->innerJoin('order_main c', 'a.order_id = c.order_id')
+ ->leftJoin('prod_main b', 'a.prod_id=b.prod_id')
+ ->select(['b.prod_name', 'a.unit_price prod_single_price', 'a.count prod_count', 'a.commission' // update fuhc add b.commission on 2017-05-26
+// '(select TRUNCATE(total_money/c.prod_cnt,0)*a.count from fx_commission_info where order_id =a.order_id ) as commission'
+ ])
+ ->where(['and', ['=', 'a.order_id', $order_id], ['!=', 'a.count', 0]])
+ ->asArray()
+ ->all();
+ return $result;
+ }
+
+ /**
+ * Des:根据订单ID获取佣金详细
+ * Name: getInfoByOrderId
+ * @param $oder_id
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getInfoByOrderId($oder_id)
+ {
+ $orderInfo = self::find()
+ ->from(static::tableName())
+ ->where(['=', 'order_id', $oder_id])
+ ->asArray()
+ ->one();
+ return $orderInfo;
+ }
+
+ /**
+ * Des:修改单状态
+ * Name: editStatus
+ * @param $oder_id
+ * @param $status
+ * @return int
+ * @author 倪宗锋
+ */
+ public function editStatus($oder_id, $status)
+ {
+ $flag = self::updateAll(['status' => $status], ['=', 'order_id', $oder_id]);
+ return $flag;
+ }
+}
diff --git a/common/models/FxUser.php b/common/models/FxUser.php
new file mode 100644
index 0000000..203c252
--- /dev/null
+++ b/common/models/FxUser.php
@@ -0,0 +1,428 @@
+ 100],
+ [['openid', 'wx_openid'], 'string', 'max' => 120],
+ [['phone'], 'string', 'max' => 11],
+ [['nickname'], 'string', 'max' => 100],
+ [['headimgurl', 'country', 'province', 'city', 'user_area'], 'string', 'max' => 255],
+ [['openid'], 'unique'],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'uid' => 'Uid',
+ 'user_name' => 'User Name',
+ 'openid' => 'Openid',
+ 'phone' => 'Phone',
+ 'nickname' => 'Nickname',
+ 'headimgurl' => 'Headimgurl',
+ 'sex' => 'Sex',
+ 'country' => 'Country',
+ 'province' => 'Province',
+ 'city' => 'City',
+ 'status' => 'Status',
+ 'reg_time' => 'Reg Time',
+ 'delete_flag' => 'Delete Flag',
+ 'wx_openid' => 'Wx Openid',
+ 'main_user_id' => 'Main User ID',
+ 'change_price_power' => 'change_price_power',
+ 'user_area' => 'user_area'
+ ];
+ }
+
+ /**
+ * Function Description:验证是否已注册手机号
+ * Function Name: checkPhone
+ *
+ * @return array
+ *
+ * @author 娄梦宁
+ */
+ public function checkPhone()
+ {
+ $cookies = Yii::$app->request->cookies;
+ $user_id = $cookies->getValue('user_id');
+ $phone = self::find()->select('phone')
+ ->where(['uid' => $user_id])
+ ->one();
+ return $phone;
+ }
+
+ /**
+ * Function Description:注册手机号
+ * Function Name: registerPhone
+ * @param $phone
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function registerPhone($phone)
+ {
+ $values = [
+ 'phone' => $phone
+ ];
+ $base_one = self::findOne(['uid' => FxUtil::$uid, 'delete_flag' => 0]);
+ $req = "/^.*[0-9a-zA-Z_\x{4e00}-\x{9fa5}].*$/u";
+ if (Util::checkPattern('', $base_one->nickname, $req) == false) {//如果用户名是空则用户名设置为手机号
+ $values['nickname'] = $phone;
+ }
+ $base_one->attributes = $values;
+ $res = $base_one->update();
+ if ($res === false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Des:根据openid获取用户ID
+ * Name: getUidByOpenid
+ * @param $openid
+ * @return mixed|string
+ * @author 倪宗锋
+ */
+ public function getInfoByOpenid($openid)
+ {
+ $getUserInfo = self::find()->select(['uid', 'phone', 'status'])
+ ->where(array('openid' => $openid))
+ ->asArray(true)
+ ->one();
+ if ($getUserInfo == null) {
+ return '';
+ }
+ return $getUserInfo;
+ }
+
+ /**
+ * Des:添加用户信息
+ * Name: addUserFromWeChat
+ * @param $params
+ * @return bool
+ * @throws \Exception
+ * @throws bool
+ * @author 倪宗锋
+ */
+ public function addUserFromWeChat($params)
+ {
+ $this->setAttributes($params);
+ $return = $this->insert(true);
+ return $return;
+ }
+
+
+ /**
+ * Des:获取用户信息
+ * Name: getUserInfoByUid
+ * @param $uid
+ * @return array|null|string|ActiveRecord
+ * @author 倪宗锋
+ */
+ public function getUserInfoByUid($uid)
+ {
+ $userInfo = self::find()
+ ->where(array('uid' => $uid))
+ ->asArray(true)
+ ->one();
+ if ($userInfo == null) {
+ return '';
+ }
+ return $userInfo;
+ }
+
+ /**
+ * Function Description:获取分销商列表
+ * Function Name: getUserList
+ * @param $param
+ *
+ * @return array|\yii\db\ActiveRecord[]
+ *
+ * @author 娄梦宁
+ */
+ public function getUserList($param)
+ {
+ $where = ['and', ['!=', 'phone', '']];
+ if (empty($param['wechat_name']) == false) {
+ $where[] = ['like', 'nickname', $param['wechat_name']];
+ }
+ if (empty($param['fx_phone']) == false) {
+ $where[] = ['like', 'phone', $param['fx_phone']];
+ }
+ if (empty($param['start_reg_time']) == false) {
+ $where[] = ['>=', 'reg_time', $param['start_reg_time']];
+ }
+ if (empty($param['end_reg_time']) == false) {
+ $where[] = ['<', 'reg_time', date('Y-m-d', strtotime("{$param['end_reg_time']} +1 day"))];
+ }
+ if (empty($param['main_user_id']) == false) {
+ $where[] = ['=', 'a.main_user_id', $param['main_user_id']];
+ }
+ if (empty($param['user_area']) == false) {
+ $where[] = ['=', 'a.user_area', $param['user_area']];
+ }
+ //果运营主体非1或空,则读取自身对应的订单数据,如果运营主体为空,或者运营主体是1则读取订单运营主体是0或1的订单
+ $cookies = $_COOKIE;
+ if (empty($cookies['user_main_corp']) == false && $cookies['user_main_corp'] != 1 && in_array(YII_ENV,['pro','dev'])) {
+ $where[] = ['=', 'e.main_corp_id', $cookies['user_main_corp']];
+ }
+ $offset = ($param['current_page'] - 1) * $param['page_size'];
+ $select = [
+ 'a.uid as fx_uid',
+ new Expression('FORMAT(b.remaining_sum,0) as remaining_sum'),
+ 'a.nickname as wechat_name',
+ "ifnull(a.user_name,'') user_name",
+ 'a.phone as fx_phone',
+ 'a.reg_time',
+ 'b.status as fx_status_id',
+ "if(b.status=1,'已启用','未启用') as fx_status",
+ 'ifnull(b.total_commission,0) as total_commission',
+ 'ifnull(b.closed_commission,0) as closed_commission',
+ 'ifnull(b.available_commission,0) available_commission',
+ 'change_price_power' => new Expression("SUBSTR(change_price_power FROM 1 FOR 1)"),//巴士自由行的改价权限
+ 'change_price_power_hotel' => new Expression("SUBSTR(change_price_power FROM 2 FOR 1)"),//酒店的改价权限
+ 'main_user_name' => new Expression("ifnull((SELECT user_name from main_corp_user WHERE id= a.main_user_id),'')"),
+ 'main_corp_name' => new Expression("ifnull((SELECT main_corp_name from main_corp_user WHERE id= a.main_user_id),'')"),
+ 'user_area' => new Expression("ifnull((SELECT GROUP_CONCAT(area_name SEPARATOR '') from fx_user_area WHERE FIND_IN_SET(area_id,a.user_area)),'')")
+ ];
+ $result = self::find()->select($select)
+ ->from(self::tableName() . ' as a')
+ ->innerJoin('fx_user_account as b', ' b.fx_uid=a.uid')
+ ->leftJoin(MainCorpUser::tableName() . ' e', 'a.main_user_id = e.id')
+ ->where($where)
+ ->orderBy('a.reg_time desc')
+ ->offset($offset)
+ ->limit($param['page_size'])
+ ->asArray()
+ ->all();
+ $result1 = self::find()->select('count(1) as count')
+ ->from(self::tableName() . ' as a')
+ ->innerJoin('fx_user_account as b', ' b.fx_uid=a.uid')
+ ->leftJoin(MainCorpUser::tableName() . ' e', 'a.main_user_id = e.id')
+ ->asArray()
+ ->where($where)
+ ->one();
+ $result1 = $result1['count'];
+ return ['list' => $result,
+ 'count' => $result1
+ ];
+ }
+
+ /*
+ * 分销商审核列表
+ */
+ public function CheckFxUser($param)
+ {
+ $where = ['and', ['=', 'a.delete_flag', '0']];
+ if ($param['wechat_name'] != '') {
+ $where[] = ['like', 'a.nickname', $param['wechat_name']];
+ }
+ if ($param['fx_phone'] != '') {
+ $where[] = ['like', 'a.phone', $param['fx_phone']];
+ }
+ if ($param['start_reg_time'] != '') {
+ $where[] = ['>=', 'a.reg_time', $param['start_reg_time']];
+ }
+ if ($param['end_reg_time'] != '') {
+ $where[] = ['<', 'a.reg_time', date('Y-m-d', strtotime("{$param['end_reg_time']} +1 day"))];
+ }
+ if ($param['status'] != '') {
+ $where[] = ['=', 'a.status', $param['status']];
+ }
+ if (empty($param['main_user_id']) == false) {
+ $where[] = ['=', 'a.main_user_id', $param['main_user_id']];
+ }
+ if (empty($param['user_area']) == false) {
+ $where[] = ['=', 'a.user_area', $param['user_area']];
+ }
+ //果运营主体非1或空,则读取自身对应的订单数据,如果运营主体为空,或者运营主体是1则读取订单运营主体是0或1的订单
+ $cookies = $_COOKIE;
+ if (empty($cookies['user_main_corp']) == false && !in_array($cookies['user_main_corp'], [1, 34])) {
+ $where[] = ['=', 'e.main_corp_id', $cookies['user_main_corp']];
+ }
+ $offset = ($param['current_page'] - 1) * $param['page_size'];
+ $select = [
+ 'a.nickname',
+ "ifnull(a.user_name,'') user_name",
+ 'a.phone',
+ 'a.reg_time',
+ "if(a.status = 1,'审核未通过',if(a.status=2,'审核通过','待审核')) as status_type",
+ 'a.uid as fx_uid',
+ 'a.status',
+ 'main_user_name' => new Expression("ifnull((SELECT user_name from main_corp_user WHERE id= a.main_user_id),'')"),
+ 'main_corp_name' => new Expression("ifnull((SELECT main_corp_name from main_corp_user WHERE id= a.main_user_id),'')")
+ ];
+ $result = self::find()->select($select)
+ ->from(self::tableName() . ' a')
+ ->leftJoin(MainCorpUser::tableName() . ' e', 'a.main_user_id = e.id')
+ ->where($where)
+ ->orderBy('a.reg_time desc')
+ ->offset($offset)
+ ->limit($param['page_size'])
+ ->asArray()
+ ->all();
+ $result1 = self::find()->select('count(1) as count')
+ ->from(self::tableName() . ' a')
+ ->leftJoin(MainCorpUser::tableName() . ' e', 'a.main_user_id = e.id')
+ ->asArray()
+ ->where($where)
+ ->one();
+ $result1 = $result1['count'];
+ return ['list' => $result,
+ 'count' => $result1
+ ];
+ }
+
+ /*
+ * 分销商审核通过
+ */
+ public function ThroughFxUser($fx_uid, $status)
+ {
+ $count = self::updateAll(['status' => $status], ['=', 'uid', $fx_uid]);
+ return $count;
+ }
+
+ /**
+ * Des:修改用户名
+ * Name: updateUserName
+ * @param $fx_uid
+ * @param $user_name
+ * @return int
+ * @author 倪宗锋
+ */
+ public function updateUserName($fx_uid, $user_name)
+ {
+ $count = self::updateAll(['user_name' => $user_name], ['=', 'uid', $fx_uid]);
+ return $count;
+ }
+
+ /**
+ * Des:绑定运维负责人
+ * Name: updateUserName
+ * @param $fx_uid
+ * @param $main_user_id
+ * @return int
+ * @author 倪宗锋
+ */
+ public function bindMainCorp($fx_uid, $main_user_id)
+ {
+ $count = self::updateAll(['main_user_id' => $main_user_id], ['=', 'uid', $fx_uid]);
+ return $count;
+ }
+
+ /**
+ * Des:获取用户详细
+ * Name: getUserInfo
+ * @param $fx_uid
+ * @return array|null|ActiveRecord
+ * @author 倪宗锋
+ */
+ public function getUserInfo($fx_uid)
+ {
+ $select = [
+ 'a.uid',
+ 'a.nickname',
+ 'a.phone',
+ 'a.main_user_id',
+ 'b.id',
+ 'b.user_name',
+ 'b.main_corp_id',
+ 'b.main_corp_name',
+ 'a.user_area'
+ ];
+ $info = self::find()->select($select)
+ ->from(static::tableName() . ' a')
+ ->leftJoin(MainCorpUser::tableName() . ' b', 'a.main_user_id = b.id')
+ ->where(['=', 'a.uid', $fx_uid])
+ ->asArray()
+ ->one();
+ return $info;
+ }
+
+ /**
+ * Function Description:修改用户改价权限
+ * Function Name: uptChangePricePower
+ * @param $fx_uid
+ * @param $change_price_power
+ * @param $type
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function uptChangePricePower($fx_uid, $change_price_power, $type)
+ {
+// print_r([$type,$change_price_power,$change_price_power]);die;
+ try {
+ self::updateAll(['change_price_power' => new Expression("INSERT(change_price_power,$type,1,$change_price_power)")], ['=', 'uid', $fx_uid]);
+ return true;
+ } catch (Exception $e) {
+ return false;
+ }
+ }
+
+ /**
+ * Des:修改用户名
+ * Name: updateUserName
+ * @param $fx_uid
+ * @param $userArea
+ * @return int
+ * @author 倪宗锋
+ */
+ public function updateUserArea($fx_uid, $userArea)
+ {
+ $count = self::updateAll(['user_area' => $userArea], ['=', 'uid', $fx_uid]);
+ return $count;
+ }
+}
diff --git a/common/models/FxUserAccount.php b/common/models/FxUserAccount.php
new file mode 100644
index 0000000..bd1e19e
--- /dev/null
+++ b/common/models/FxUserAccount.php
@@ -0,0 +1,226 @@
+ 'ID',
+ 'fx_uid' => 'Fx Uid',
+ 'available_commission' => 'Available Commission',
+ 'closed_commission' => 'Closed Commission',
+ 'total_commission' => 'Total Commission',
+ 'apply_commission' => 'Apply Commission',
+ 'create_time' => 'Create Time',
+ 'update_time' => 'Update Time',
+ 'status' => 'Status',
+ 'delete_flag' => 'Delete Flag',
+ ];
+ }
+
+ /**
+ * Function Description:获取账户信息
+ * Function Name: getMyCommission
+ * @return array|null|\yii\db\ActiveRecord
+ *
+ * @author 娄梦宁
+ */
+ public function getMyCommission($fx_uid = '')
+ {
+ if (empty($fx_uid)) {
+ $fx_uid = FxUtil::$uid;
+ }
+ $select = [
+ 'a.headimgurl',
+ 'a.phone',
+ 'a.nickname',
+ 'b.status as accountStatus',
+ 'ifnull(b.available_commission,0) available_commission',
+ 'ifnull(b.total_commission,0) total_commission',
+ 'ifnull(b.apply_commission,0) apply_commission',
+ 'FORMAT(ifnull(b.remaining_sum,0),0) remaining_sum_s',
+ 'b.remaining_sum',
+ 'wx_openid'
+ ];
+ $result = self::find()->select($select)
+ ->from('fx_user as a')
+ ->leftJoin(self::tableName() . ' as b', 'a.uid=b.fx_uid')
+ ->where(['=', 'a.uid', $fx_uid])
+ ->asArray()
+ ->one();
+ return $result;
+ }
+
+ public function ApplyCommission($available_commission, $new_apply_commission)
+ {
+ $values = [
+ 'available_commission' => $available_commission,
+ 'apply_commission' => $new_apply_commission
+ ];
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+ $base_one = self::findOne(['fx_uid' => FxUtil::$uid, 'delete_flag' => 0, 'status' => 1]);
+ $base_one->attributes = $values;
+ $res = $base_one->update();
+ if (!$res) {
+ throw new Exception('修改出错');
+ }
+ $transaction->commit();
+ return true;
+ } catch (Exception $e) {
+ # 回滚事务
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+ /**
+ * Function Description:分销商注册手机号后开账户
+ * Function Name: InsertNewUser
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function InsertNewUser()
+ {
+ $values = [
+ 'fx_uid' => FxUtil::$uid,
+ 'create_time' => date('Y-m-d H:i:s')
+ ];
+ $this->attributes = $values;
+ $res = $this->insert();
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+
+ /*
+ * 提现后用户账户变化
+ */
+ public function changeAccount($apply_id)
+ {
+ $fx_info = FxCommissionApply::find()->select(['fx_uid', 'apply_money'])
+ ->from('fx_commission_apply')
+ ->where(['id' => $apply_id])
+ ->asArray()
+ ->one();
+ $money = (int)$fx_info['apply_money'];
+ $fx_uid = $fx_info['fx_uid'];
+ $sql = "UPDATE fx_user_account
+ set apply_commission=apply_commission -$money,
+ closed_commission=closed_commission+$money
+ where fx_uid=$fx_uid
+ ";
+ $res = $this->getDb()->createCommand($sql)->execute();
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Des:修改分销账户状态
+ * Name: changeStatus
+ * @param $param
+ * @return int
+ * @author 倪宗锋
+ */
+ public function changeStatus($param)
+ {
+ if ($param['fx_status_id'] == 2) {
+ $status = 1;
+ } else {
+ $status = 2;
+ }
+ $count = self::updateAll(['status' => $status], ['=', 'fx_uid', $param['fx_uid']]);
+ return $count;
+ }
+
+ /**
+ * Des:扣除用户余额
+ * Name: changeStatus
+ * @param $fx_uid
+ * @param $money
+ * @return bool
+ * @author 倪宗锋
+ */
+ public function deductAmount($fx_uid, $money)
+ {
+ $sql = "UPDATE fx_user_account
+ set remaining_sum=remaining_sum - $money
+ where fx_uid=$fx_uid
+ ";
+ $res = $this->getDb()->createCommand($sql)->execute();
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Des:用户余额充值
+ * Name: changeStatus
+ * @param $fx_uid
+ * @param $money
+ * @return bool
+ * @author 倪宗锋
+ */
+ public function rechargeAmount($fx_uid, $money)
+ {
+ $sql = "UPDATE fx_user_account
+ set remaining_sum=remaining_sum + $money
+ where fx_uid=$fx_uid
+ ";
+ $res = $this->getDb()->createCommand($sql)->execute();
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/common/models/FxUserAmountLog.php b/common/models/FxUserAmountLog.php
new file mode 100644
index 0000000..7e2a2a8
--- /dev/null
+++ b/common/models/FxUserAmountLog.php
@@ -0,0 +1,107 @@
+ 255],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'log_id' => 'log_id',
+ 'fx_uid' => 'fx_uid',
+ 'amount' => 'amount',
+ 'remaining_sum' => 'remaining_sum',
+ 'trade_type' => 'trade_type',
+ 'create_time' => 'create_time',
+ 'update_time' => 'Update Time',
+ 'msg' => 'msg',
+ ];
+ }
+
+ /**
+ * 添加记录
+ * @param $fx_uid
+ * @param $trade_type
+ * @param $amount
+ * @param $msg
+ * @return array
+ */
+ public function addLog($fx_uid, $trade_type, $amount, $remaining_sum, $msg)
+ {
+ $param = [
+ 'fx_uid' => $fx_uid,
+ 'amount' => $amount,
+ 'trade_type' => $trade_type,
+ 'remaining_sum' => $remaining_sum,
+ 'create_time' => date('Y-m-d H:i:s'),
+ 'msg' => $msg
+ ];
+ $this->attributes = $param;
+ $insertFlag = $this->insert();
+ if (!$insertFlag) {
+ return Util::returnArrEr('add amount_log fail!');
+ }
+ return Util::returnArrSu();
+ }
+
+ /**
+ * 获取账户变更记录
+ * @param $params
+ * @return array
+ */
+ public function getList($params)
+ {
+ $offset = ($params['current_page'] - 1) * $params['page_size'];
+ $select = [
+ new Expression('FORMAT(amount,0) as amount'),
+ 'trade_type',
+ new Expression('FORMAT(remaining_sum,0) as remaining_sum'),
+ 'create_time',
+ new Expression("if(trade_type=1,'充值',if(trade_type=2,'支出','退款')) as type_name")
+ ];
+ $where = ['=', 'fx_uid', $params['fx_uid']];
+ $result = self::find()->select($select)
+ ->from(self::tableName())
+ ->where($where)
+ ->orderBy('create_time DESC')
+ ->offset($offset)
+ ->limit($params['page_size'])
+ ->asArray()
+ ->all();
+ return $result;
+ }
+
+
+}
\ No newline at end of file
diff --git a/common/models/FxUserAmountOrder.php b/common/models/FxUserAmountOrder.php
new file mode 100644
index 0000000..8aadeac
--- /dev/null
+++ b/common/models/FxUserAmountOrder.php
@@ -0,0 +1,180 @@
+ 100],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'fx_uid' => 'fx_uid',
+ 'amount' => 'amount',
+ 'status' => 'status',
+ 'create_time' => 'create_time',
+ 'update_time' => 'Update Time',
+ 'recharge_order' => 'recharge_order',
+ 'pay_type' => 'pay_type'
+ ];
+ }
+
+ /**
+ * 添加新记录
+ * @param $fx_uid
+ * @param $amount
+ * @param $payType
+ * @return array
+ */
+ public function addAmountOrder($fx_uid, $amount, $payType = 1)
+ {
+ $params = [
+ 'recharge_order' => 'FXA' . round(microtime(true) * 1000, 0),
+ 'fx_uid' => $fx_uid,
+ 'amount' => $amount,
+ 'pay_type' => $payType,
+ 'create_time' => date('Y-m-d H:i:s')
+ ];
+ $this->attributes = $params;
+ $insertFlag = $this->insert();
+ if (!$insertFlag) {
+ return Util::returnArrEr('add amount_order fail!');
+ }
+ return Util::returnArrSu('', ['recharge_order' => $params['recharge_order']]);
+ }
+
+ /**
+ * 获取列表
+ * @param $params
+ * @param $type
+ * @return array
+ */
+ public function getList($params, $type = 0)
+ {
+ $where = [
+ 'and',
+ ['=', 'fx_uid', $params['fx_uid']],
+ ['=', 'status', 2]
+ ];
+ if ($type == 1) {
+ $select = ["count(1) cnt"];
+ $getResult = self::find()->select($select)
+ ->where($where)
+ ->orderBy('create_time DESC')
+ ->asArray()
+ ->one();
+ $result = $getResult['cnt'];
+ } else {
+ $select = [
+ 'id',
+ new Expression('FORMAT(amount,0) as amount'),
+ 'create_time',
+ 'recharge_order',
+ "if(pay_type=1,'微信','支付宝') as pay_type",
+ 'fx_uid',
+ 'status'
+ ];
+ $offset = ($params['current_page'] - 1) * $params['page_size'];
+ $result = self::find()->select($select)
+ ->where($where)
+ ->orderBy('create_time DESC')
+ ->offset($offset)
+ ->limit($params['page_size'])
+ ->asArray()
+ ->all();
+ }
+ return $result;
+ }
+
+ /**
+ * 获取充值记录单的详情
+ * @param $recharge_order
+ * @return array
+ */
+ public function getAmountOrderInfo($recharge_order)
+ {
+ $select = [
+ 'id',
+ 'amount',
+ 'create_time',
+ 'recharge_order',
+ "if(pay_type=1,'微信','支付宝') as pay_type",
+ 'fx_uid',
+ 'status'
+ ];
+ $result = self::find()->select($select)
+ ->where(['=', 'recharge_order', $recharge_order])
+ ->asArray()
+ ->one();
+ return $result;
+ }
+
+ /**
+ * 修改充值单状态
+ * @param $recharge_order
+ * @param $status
+ * @return int
+ */
+ public function updateStatus($recharge_order, $status)
+ {
+ $values = [
+ 'status' => $status
+ ];
+ $count = self::updateAll($values, ['and', ['=', 'recharge_order', $recharge_order]]);
+ return $count;
+ }
+
+ /**
+ * 获取未支付订单
+ * @return array
+ */
+ public function getUnPayOrder()
+ {
+ $select = [
+ 'id',
+ 'amount',
+ 'create_time',
+ 'recharge_order',
+ "pay_type",
+ 'fx_uid',
+ 'status'
+ ];
+ $result = self::find()->select($select)
+ ->where(['=', 'status', 1])
+ ->asArray()
+ ->one();
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/common/models/FxUserArea.php b/common/models/FxUserArea.php
new file mode 100644
index 0000000..27e00f4
--- /dev/null
+++ b/common/models/FxUserArea.php
@@ -0,0 +1,65 @@
+ 100],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'area_id' => 'Area ID',
+ 'area_name' => 'Area Name',
+ ];
+ }
+
+ /**
+ * Des:获取用户所属区域列表
+ * Name: getUserAreaList
+ * @param string $user_area
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getUserAreaList($user_area = '')
+ {
+ $select = [
+ 'is_bind' => empty($user_area) ? new Expression("0") : new Expression("if(area_id in ($user_area),1,0)"),
+ 'area_id',
+ 'area_name'
+ ];
+ $getList = self::find()->select($select)
+ ->asArray()
+ ->all();
+ return $getList;
+ }
+}
diff --git a/common/models/FxUserQrcode.php b/common/models/FxUserQrcode.php
new file mode 100644
index 0000000..3b014a5
--- /dev/null
+++ b/common/models/FxUserQrcode.php
@@ -0,0 +1,106 @@
+ 'ID',
+ 'fx_uid' => 'Fx Uid',
+ 'qr_id' => 'Qr ID',
+ ];
+ }
+
+ /**
+ * Des:根据qrId获取详细
+ * Name: getInfoByQrId
+ * @param $qrCodeId
+ * @return array|null|\yii\db\ActiveRecord
+ * @author 倪宗锋
+ */
+ public function getInfoByQrId($qrCodeId)
+ {
+ $where = ['=', 'qr_id', $qrCodeId];
+ $select = ['fx_uid', 'qr_id'];
+ $getInfo = self::find()->select($select)
+ ->where($where)
+ ->asArray()
+ ->one();
+ return $getInfo;
+ }
+
+ /**
+ * Des:添加新记录
+ * Name: addNew
+ * @param $qrCodeId
+ * @return bool
+ * @author 倪宗锋
+ */
+ public function addNew($qrCodeId)
+ {
+ $params = [
+ 'qr_id' => $qrCodeId,
+ 'fx_uid' => 0
+ ];
+ $this->setAttributes($params);
+ $return = $this->insert(false);
+ return $return;
+ }
+
+ /**
+ * Des:获取所有列表数据
+ * Name: getList
+ * @return array|\yii\db\ActiveRecord[]
+ * @author 倪宗锋
+ */
+ public function getList()
+ {
+ $select = [
+ 'a.fx_uid',
+ 'a.qr_id',
+ 'img_url' => new Expression("concat('/web/fx/images/FxQrCode/',a.qr_id,'.jpg')"),
+ 'nickname' => new Expression("if(b.nickname is null,'未设置',concat(b.nickname,' - ',b.phone))")
+ ];
+ $getList = self::find()->select($select)
+ ->from(static::tableName().' a')
+ ->leftJoin(FxUser::tableName().' b','a.fx_uid = b.uid')
+ ->asArray()
+ ->all();
+ return $getList;
+ }
+
+}
diff --git a/common/models/LogOrder.php b/common/models/LogOrder.php
new file mode 100644
index 0000000..88b5ea7
--- /dev/null
+++ b/common/models/LogOrder.php
@@ -0,0 +1,80 @@
+ 20],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'name' => 'Name',
+ 'order_id' => 'Order ID',
+ 'time' => 'Time',
+ 'uid' => 'Uid',
+ 'u_type' => 'U Type',
+ 'log_type' => 'Log Type',
+ ];
+ }
+
+ /**
+ * Des:获取订单日志列表
+ * Name: getOrderLog
+ * @param $order_id
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getOrderLog($order_id)
+ {
+ $where = ['=', 'order_id',$order_id];
+ $select = [
+ 'name',
+ 'time',
+ 'log_type'
+ ];
+ $getList = self::find()->select($select)
+ ->where($where)
+ ->asArray(true)
+ ->all();
+ if (empty($getList)) {
+ return [];
+ }
+ return $getList;
+ }
+}
diff --git a/common/models/LogUserOperation.php b/common/models/LogUserOperation.php
new file mode 100644
index 0000000..79a14bf
--- /dev/null
+++ b/common/models/LogUserOperation.php
@@ -0,0 +1,141 @@
+ 120],
+ [['user_name', 'resources_name', 'phpsessid', 'user_agent','last_login'], 'string', 'max' => 255],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'title' => 'Title',
+ 'memo' => 'Memo',
+ 'uid' => 'Uid',
+ 'user_type' => 'User Type',
+ 'user_name' => 'User Name',
+ 'resources_id' => 'Resources ID',
+ 'resources_type' => 'Resources Type',
+ 'resources_name' => 'Resources Name',
+ 'phpsessid' => 'Phpsessid',
+ 'user_agent' => 'User Agent',
+ 'create_time' => 'Crate Time',
+ 'last_login' => 'last_login'
+ ];
+ }
+
+ public function getList($param, $type)
+ {
+ //where条件
+ $where = ['and'];
+ if ($param['user_name'] != '') {
+ $where[] = ['=', 'user_name', $param['user_name']];
+ }
+ if ($param['title'] != '') {
+ $where[] = ['like', 'title', $param['title']];
+ }
+ if ($param['resource_id'] != '') {
+ $where[] = ['=', 'resources_id', $param['resource_id']];
+ }
+ if ($param['create_time_start'] != '') {
+ $where[] = ['>=', 'create_time', $param['create_time_start']];
+ }
+ if ($param['create_time_end'] != '') {
+ $where[] = ['<', 'create_time', date('Y-m-d', strtotime("{$param['create_time_end']} +1 day"))];
+ }
+ if ($type == 1) {//获取count
+ $select = ["count(1) cnt"];
+ $result = self::find()->select($select)
+ ->where($where)
+ ->asArray()
+ ->one();
+ return $result['cnt'];
+ } else {//获取列表
+ //查询字段
+ $select = [
+ 'id',
+ 'title',
+ 'memo' ,
+ 'uid' ,
+ 'user_type',
+ 'user_name',
+ 'resources_id'=>new Expression("if(resources_id=0,' - ',resources_id)"),
+ 'resources_type',
+ 'resources_name',
+ 'phpsessid',
+ 'user_agent',
+ 'create_time',
+ 'last_login',
+ new Expression("CASE user_type
+ WHEN 1 THEN '管理员'
+ WHEN 2 THEN '分销商'
+ WHEN 3 THEN '客户'
+ WHEN 4 THEN 'CS管理员'
+ ELSE '-'
+ END
+ as user_type_name
+ "),
+ new Expression("CASE resources_type
+ WHEN 1 THEN '产品'
+ WHEN 2 THEN '订单'
+ ELSE '-'
+ END
+ as resources_type_name
+ ")
+ ];
+ $offset = ($param['current_page'] - 1) * $param['page_size'];
+ $result = self::find()->select($select)
+ ->where($where)
+ ->orderBy('create_time DESC')
+ ->offset($offset)
+ ->limit($param['page_size'])
+ ->asArray()
+ ->all();
+ return $result;
+ }
+ }
+}
diff --git a/common/models/MainCorpUser.php b/common/models/MainCorpUser.php
new file mode 100644
index 0000000..216b0ac
--- /dev/null
+++ b/common/models/MainCorpUser.php
@@ -0,0 +1,64 @@
+ 255],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'user_name' => 'User Name',
+ 'main_corp_id' => 'Main Corp ID',
+ 'main_corp_name' => 'Main Corp Name',
+ ];
+ }
+
+ /**
+ * Des:根据主体获取运营负责人列表
+ * Name: getListForUserMianCorp
+ * @author 倪宗锋
+ */
+ public function getListForUserMainCorp()
+ {
+ $where = [];
+ $cookies = $_COOKIE;
+ if (empty($cookies['user_main_corp'])== false && $cookies['user_main_corp'] != 1) {
+ $where = ['=', 'main_corp_id', $cookies['user_main_corp']];
+ }
+ $list = self::find()->where($where)->asArray()->all();
+ return $list;
+ }
+}
diff --git a/common/models/OrderContacts.php b/common/models/OrderContacts.php
new file mode 100644
index 0000000..d187207
--- /dev/null
+++ b/common/models/OrderContacts.php
@@ -0,0 +1,131 @@
+ 120],
+ [['contacts_phone', 'contacts_ID'], 'string', 'max' => 20],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'order_id' => 'Order ID',
+ 'contacts_name' => 'Contacts Name',
+ 'contacts_phone' => 'Contacts Phone',
+ 'contacts_ID' => 'Contacts ID',
+ 'contacts_type' => 'Contacts Type',
+ 'update_time' => 'Update Time',
+ 'create_time' => 'Create Time',
+ 'delete_flag' => 'Delete Flag',
+ 'bus_run_id' => 'Bus Run ID',
+ ];
+ }
+
+ /**
+ * Function Description:插入联系人表
+ * Function Name: insertContacts
+ * @param $param_arr
+ * @param $orderId
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function insertContacts($param_arr, $orderId)
+ {
+ $values = [
+ 'order_id' => $orderId,
+ 'contacts_name' => $param_arr['contacts_name'],
+ 'contacts_phone' => $param_arr['contacts_phone'],
+ 'contacts_ID' => empty($param_arr['contacts_ID']) ? '' : $param_arr['contacts_ID'],
+ 'bus_run_id' => empty($param_arr['run_id']) ? 0 : $param_arr['run_id'],
+ 'create_time' => date('Y-m-d H:i:s'),
+ ];
+ $this->attributes = $values;
+ $res = $this->insert();
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Des:获取订单拓展信息
+ * Name: getRowByOrderId
+ * @param $orderId
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getRowByOrderId($orderId)
+ {
+ $where = ['and'];
+ $where[] = ['=', 'order_id', $orderId];
+ $where[] = ['=', 'contacts_type', 1];
+ $return = $this->find()->select(['contacts_name', 'contacts_phone', 'contacts_ID', 'contacts_type', 'bus_run_id', 'order_id'])
+ ->from(static::tableName())
+ ->where($where)
+ ->asArray(true)
+ ->one();
+ return $return;
+ }
+
+ /**
+ * Des:获取保险数量
+ * Name: getInsurance
+ * @param $orderId
+ * @return int
+ * @author 倪宗锋
+ */
+ public function getInsuranceCnt($orderId)
+ {
+ $where = ['and'];
+ $where[] = ['=', 'order_id', $orderId];
+ $where[] = ['=', 'contacts_type', 2];
+ $return = $this->find()->select(['contacts_name', 'contacts_phone', 'contacts_ID', 'contacts_type', 'bus_run_id', 'order_id'])
+ ->from(static::tableName())
+ ->where($where)
+ ->asArray(true)
+ ->count();
+ return $return;
+ }
+}
diff --git a/common/models/OrderInfo.php b/common/models/OrderInfo.php
new file mode 100644
index 0000000..6ca331d
--- /dev/null
+++ b/common/models/OrderInfo.php
@@ -0,0 +1,129 @@
+ 'ID',
+ 'order_id' => 'Order ID',
+ 'prod_id' => 'Prod ID',
+ 'count' => 'Count',
+ 'unit_price' => 'Unit Price',
+ 'total_price' => 'Total Price',
+ 'delete_flag' => 'Delete Flag',
+ ];
+ }
+
+ /**
+ * Function Description:插入子订单
+ * Function Name: insertInfo
+ * @param $prod_arr
+ * @param $oderId
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function insertInfo($prod_arr, $oderId)
+ {
+ $sql = "INSERT into order_info(order_id, total_price, count, unit_price, prod_id,commission)
+ SELECT {$oderId}, prod_price*{$prod_arr['prod_count']} price,
+ {$prod_arr['prod_count']},prod_price,prod_id,commission
+ from prod_main
+ where prod_id ={$prod_arr['prod_id']}";
+ $res = $this->getDb()->createCommand($sql)->execute();
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Function Description:获取订单佣金
+ * Function Name: insertInfo
+ * @param $orderId int
+ * @return int
+ * @author 娄梦宁
+ */
+ public function getOrderCommission($orderId)
+ {
+ $select = [
+ new Expression("IFNULL(SUM(b.commission*a.count),0) 'commission'"),
+ 'order_id'
+ ];
+ try{
+ $result =self::find()->select($select)
+ ->from(self::tableName().' as a')
+ ->innerJoin(ProdMain::tableName().' as b','a.prod_id = b.prod_id')
+ ->where(['=','a.order_id',$orderId])
+ ->asArray()
+ ->one();
+ }catch (Exception $e) {
+ $result['commission'] = 0;
+ }
+ return $result['commission'];
+ }
+
+ /**
+ * Des:获取产品数组
+ * Name: getFreeWalkProdArr
+ * @param $order_id
+ * @return array
+ * @author 倪宗锋
+ */
+ public function geProdArr($order_id){
+ $select = [
+ 'prod_id'=> 'b.bus_id',
+ 'prod_name'=> 'b.prod_name',
+ 'prod_num' => 'a.count'
+ ];
+ $where = ['=','a.order_id', $order_id];
+ $getProdArr = self::find()->select($select)
+ ->from(self::tableName().' a')
+ ->innerJoin(ProdMain::tableName().' b','a.prod_id = b.prod_id')
+ ->where($where)
+ ->asArray(true)
+ ->all();
+ return $getProdArr;
+ }
+}
diff --git a/common/models/OrderMain.php b/common/models/OrderMain.php
new file mode 100644
index 0000000..b675b1f
--- /dev/null
+++ b/common/models/OrderMain.php
@@ -0,0 +1,633 @@
+ 255],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'order_id' => 'Order ID',
+ 'order_name' => 'Order Name',
+ 'spider_order_id' => 'Spider Order ID',
+ 'total_money' => 'Total Money',
+ 'category_id' => 'Category ID',
+ 'prod_cate_id' => 'Prod Cate ID',
+ 'prod_source' => 'Prod Source',
+ 'prod_cnt' => 'Prod Cnt',
+ 'sh_uid' => 'Sh Uid',
+ 'fx_uid' => 'Fx Uid',
+ 'start_time' => 'Start Time',
+ 'end_time' => 'End Time',
+ 'start_date' => 'Start Date',
+ 'end_date' => 'End Date',
+ 'order_status' => 'Order Status',
+ 'update_time' => 'Update Time',
+ 'create_time' => 'Create Time',
+ 'delete_flag' => 'Delete Flag',
+ 'system' => 'System',
+ 'start_area' => 'Start Area',
+ 'end_area' => 'End Area',
+ 'main_user_id' => 'Main User ID',
+ 'original_price' => 'original_price'
+ ];
+ }
+
+ /**
+ * Function Description:插入主订单
+ * Function Name: insertOrder
+ * @param $param_arr
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function insertOrder($param_arr)
+ {
+ $values = [
+ 'total_money' => $param_arr['total_money'],
+ 'prod_cate_id' => (int)$param_arr['pro_cate_id'],
+ 'prod_cnt' => $param_arr['prod_cnt'],
+ 'fx_uid' => $param_arr['fx_uid'],
+ 'start_date' => $param_arr['start_date'],
+ 'start_time' => $param_arr['start_time'],
+ 'sh_uid' => $param_arr['sh_uid'],
+ 'order_status' => 1,
+ 'create_time' => date('Y-m-d H:i:s'),
+ 'end_date' => date('Y-m-d', $param_arr['end_date']),
+ 'category_id' => $param_arr['category_id']
+ ];
+ $this->attributes = $values;
+ $res = $this->insert();
+ if (!$res) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Function Description:查询订单是否支付
+ * Function Name: getOrderStatus
+ * @param $order_id
+ *
+ * @return array|null|\yii\db\ActiveRecord
+ *
+ * @author 娄梦宁
+ */
+ public function getOrderStatus($order_id)
+ {
+ $result = self::find()->select(['order_status'])
+ ->from(self::tableName())
+ ->where(['and', ['=', 'order_id', $order_id], ['=', 'delete_flag', 0]])
+ ->asArray()
+ ->one();
+ return $result;
+ }
+
+ /**
+ * Des:获取订单详情
+ * Name: getOrderInfo
+ * @param $order_id
+ * @return array|null|\yii\db\ActiveRecord
+ * @author 倪宗锋
+ */
+ public function getOrderInfo($order_id)
+ {
+ $result = self::find()
+ ->from(self::tableName())
+ ->where(['and', ['=', 'order_id', $order_id], ['=', 'delete_flag', 0]])
+ ->asArray()
+ ->one();
+ return $result;
+ }
+
+ /**
+ * Function Description:分销订单列表
+ * Function Name: FxOrderList
+ * @param $params array
+ * @param $fx_uid
+ * @return array|\yii\db\ActiveRecord[]
+ *
+ * @author 娄梦宁
+ */
+ public function FxOrderList($fx_uid, $params)
+ {
+ $where = ['and', ['=', 'a.fx_uid', $fx_uid], ['=', 'a.delete_flag', 0]];
+ if (!empty($params['is_refund'])) {
+ $where[] = ['in', 'b.status', explode(',', $params['is_refund'])];
+ }
+ if (!empty($params['status'])) {
+ $where[] = ['in', 'a.order_status', explode(',', $params['status'])];
+ }
+ $offset = ($params['current_page'] - 1) * $params['page_size'];
+ $select = [
+ 'a.order_id',//订单ID
+ 'a.order_status',//订单状态
+ 'a.create_time',//创建时间
+ 'a.total_money as order_total_money',//订单金额
+ 'a.category_id',//订单类型ID
+ 'a.order_name as pro_cate_name',//产品名称
+ 'a.start_date',//出游时间
+ 'prod_str' => new Expression("(SELECT GROUP_CONCAT(CONCAT(y.prod_name,',,',x.count) SEPARATOR '||') from order_info x LEFT JOIN prod_main y on x.prod_id = y.prod_id WHERE x.order_id = a.order_id and x.count != 0)"),
+ 'b.status',//佣金状态
+ 'commission_total_money' => new Expression("ifnull(b.total_money,0)"),//佣金金额
+ "if(b.`status`=1,'待结算',if(b.`status`=2,'已结算','已取消')) as status_desc",//佣金结算状态
+ 'c.room_name',//房型名称
+ 'a.prod_cnt',//产品数量
+ 'a.end_date',//结束日期
+ 'c.total_details',//房型名称
+ ];
+ $result = self::find()->select($select)
+ ->from(self::tableName() . ' as a')
+ ->leftJoin('fx_commission_info b', 'a.order_id=b.order_id')
+ ->leftJoin('order_hotel_extra c', 'c.main_order_id = a.order_id')
+ ->where($where)
+ ->orderBy('a.create_time DESC')
+ ->limit($params['page_size'])
+ ->offset($offset)
+ ->asArray()
+ ->all();
+ return $result;
+ }
+
+ /**
+ * Function Description:获取已完成订单
+ * Function Name: getFinishOrder
+ * @param $date
+ *
+ * @return array|null|\yii\db\ActiveRecord
+ *
+ * @author 娄梦宁
+ */
+ public function getFinishOrder($date)
+ {
+ $result = self::find()->select(['GROUP_CONCAT(order_id) as order_arr'])
+ ->from(self::tableName())
+ ->where(['and', ['=', 'order_status', 2], ['<', 'end_date', $date], ['=', 'delete_flag', 0]])
+ ->asArray()
+ ->one();
+ return $result;
+ }
+
+ /**
+ * Function Description:已完成订单状态变更
+ * Function Name: uptFinishOrder
+ * @param $order_arr
+ *
+ * @return int
+ *
+ * @author 娄梦宁
+ */
+ public function uptFinishOrder($order_arr)
+ {
+ $values = [
+ 'order_status' => 3
+ ];
+ $count = self::updateAll($values, ['in', 'order_id', $order_arr]);
+ return $count;
+ }
+
+ /**
+ * Des:修改订单信息
+ * Name: upOrder
+ * @param $value
+ * @param $orderIds
+ * @return int
+ * @author 倪宗锋
+ */
+ public function upOrder($value, $orderIds)
+ {
+ $count = self::updateAll($value, ['in', 'order_id', $orderIds]);
+ return $count;
+ }
+
+ /**
+ * Function Description:取消超时订单
+ * Function Name: cancelOuttimeOrder
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function cancelOuttimeOrder()
+ {
+ $values = [
+ 'order_status' => 5
+ ];
+ $time = date('Y-m-d H:i:s', strtotime('-15 minute'));
+ $count = self::updateAll($values, ['and', ['=', 'order_status', 1], ['<', 'create_time', $time]]);
+ return $count;
+ }
+
+ /**
+ * Des:管理后台 订单列表 获取订单列表信息
+ * Name: getOrderListAdm
+ * @param $param
+ * @param int $type
+ * @return array|mixed
+ * @author 倪宗锋
+ */
+ public function getOrderListAdm($param, $type = 1)
+ {
+ //where条件
+ $where = ['and', ['!=', 'a.order_status', 1], ['!=', 'a.order_status', 5], ['=', 'a.delete_flag', 0]];
+ if ($param['order_id'] != '') {
+ $where[] = ['like', 'a.order_id', $param['order_id']];
+ }
+ if ($param['category_id'] != '') {
+ $where[] = ['=', 'a.category_id', $param['category_id']];
+ }
+ if ($param['create_time_start'] != '') {
+ $where[] = ['>=', 'a.create_time', $param['create_time_start']];
+ }
+ if ($param['create_time_end'] != '') {
+ $where[] = ['<', 'a.create_time', date('Y-m-d', strtotime("{$param['create_time_end']} +1 day"))];
+ }
+
+ if ($param['start_date_start'] != '') {
+ $where[] = ['>=', 'a.start_date', $param['start_date_start']];
+ }
+ if ($param['start_date_end'] != '') {
+ $where[] = ['<', 'a.start_date', date('Y-m-d', strtotime("{$param['start_date_end']} +1 day"))];
+ }
+ if ($param['order_status'] != '') {
+ $where[] = ['=', 'a.order_status', $param['order_status']];
+ }
+ if ($param['fx_uid'] != '') {
+ $where[] = ['=', 'a.fx_uid', $param['fx_uid']];
+ }
+ if ($param['pay_type'] != '') {
+ $where[] = ['=', 'd.pay_type', $param['pay_type']];
+ }
+ if (empty($param['user_area']) == false) {
+ $where[] = ['=', 'g.user_area', $param['user_area']];
+ }
+ //果运营主体非1或空,则读取自身对应的订单数据,如果运营主体为空,或者运营主体是1则读取订单运营主体是0或1的订单
+ $cookies = $_COOKIE;
+ if (empty($cookies['user_main_corp']) == false && $cookies['user_main_corp'] != 1 && in_array(YII_ENV,['pro','dev'])) {
+ $where[] = ['=', 'e.main_corp_id', $cookies['user_main_corp']];
+ }
+ //运营负责人
+ if (empty($param['main_search']) == false) {
+ $where[] = ['=', 'a.main_user_id', $param['main_search']];
+ }
+ //联系人 和手机号
+ if (empty($param['contacts_name']) == false) {
+ $where[] = ['like', 'f.contacts_name', $param['contacts_name']];
+ }
+ if (empty($param['contacts_phone']) == false) {
+ $where[] = ['like', 'f.contacts_phone', $param['contacts_phone']];
+ }
+ if ($type == 1) {//获取count
+ $select = ["count(1) cnt"];
+ $result = self::find()->select($select)
+ ->from(self::tableName() . ' a')
+ ->innerJoin('base_category c', ' a.category_id = c.category_id')
+ ->innerJoin('pay_main d', ' a.order_id = d.order_id')
+ ->leftJoin(MainCorpUser::tableName() . ' e', 'a.main_user_id=e.id')
+ ->leftJoin(OrderContacts::tableName() . ' f', 'a.order_id=f.order_id and f.contacts_type=1')
+ ->leftJoin(FxUser::tableName() . ' g', 'a.fx_uid=g.uid')
+ ->where($where)
+ ->asArray()
+ ->one();
+ return $result['cnt'];
+ } else if ($type == 3) {
+ $select = ["count(1) cnt", "sum(total_money) total_money"];
+ $where[] = ['in', 'a.order_status', [2, 3]];
+ $result = self::find()->select($select)
+ ->from(self::tableName() . ' a')
+ ->innerJoin('base_category c', ' a.category_id = c.category_id')
+ ->innerJoin('pay_main d', ' a.order_id = d.order_id')
+ ->leftJoin(MainCorpUser::tableName() . ' e', 'a.main_user_id=e.id')
+ ->leftJoin(OrderContacts::tableName() . ' f', 'a.order_id=f.order_id and f.contacts_type=1')
+ ->leftJoin(FxUser::tableName() . ' g', 'a.fx_uid=g.uid')
+ ->where($where)
+ ->asArray()
+ ->one();
+ return $result;
+ } else {//获取列表
+ //查询字段
+ $select = [
+ 'a.order_id',//订单ID
+ "a.create_time as create_order_time",//下单时间
+ "c.category_name as order_type_des",//订单类型
+ "a.order_name as book_product",//产品品类名称
+ "(
+ SELECT GROUP_CONCAT(CONCAT(x.prod_name,'X',x.count) SEPARATOR ' ')
+ from order_info x
+ WHERE x.order_id = a.order_id
+ GROUP BY x.order_id
+ ) as prod_des
+ ",//具体产品及数量
+ "CONCAT(a.start_date,' ',IFNULL(a.start_time,'')) as start_time",//出发时间
+ "(SELECT contacts_name from order_contacts where a.order_id = order_id and contacts_type=1 ) as contacts_name",
+ "(SELECT contacts_phone from order_contacts where a.order_id = order_id and contacts_type=1) as contacts_phone",
+ "(SELECT contacts_ID from order_contacts where a.order_id = order_id and contacts_type=1) as contacts_ID",
+ new Expression("CASE a.order_status
+ WHEN 1 THEN '待支付'
+ WHEN 2 THEN '已支付'
+ WHEN 3 THEN '已完成'
+ WHEN 4 THEN '已退款'
+ WHEN 5 THEN '已取消'
+ ELSE ''
+ END
+ as order_status_des
+ ")
+ ,//订单状态名称
+ "a.order_status as order_status_id",//订单状态标识ID
+ "if(d.pay_type=1,'微信',if(d.pay_type=2,'支付宝','预付款')) as pay_type_des",//支付类型名称
+ 'order_come' => new Expression("(SELECT CONCAT(nickname,'
',phone) from fx_user where a.fx_uid = uid)"),//订单来源(分销商)
+ "if(a.order_status in (1,2),
+ if(a.start_date >= '" . date('Y-m-d') . "',0,1), 1)
+ as if_can_cancel",//是否可以取消订单
+ 'a.total_money',
+ 'a.start_area',
+ 'a.end_area',
+ 'a.prod_cnt',
+ 'a.category_id',
+ 'a.end_time',
+ 'system' => new Expression("if(a.system=1,'分销',if(a.system=2,'微信','官网'))"),
+ 'user_area_name' => new Expression("(select area_name from fx_user_area where area_id = g.user_area)"),
+ 'a.remark',
+ "commission_amount" => new Expression("(SELECT SUM(total_money) from fx_commission_info WHERE order_id = a.order_id)")
+ ];
+ $offset = ($param['current_page'] - 1) * $param['page_size'];
+ $result = self::find()->select($select)
+ ->from(self::tableName() . ' a')
+ ->innerJoin('base_category c', ' a.category_id = c.category_id')
+ ->innerJoin('pay_main d', ' a.order_id = d.order_id')
+ ->leftJoin(MainCorpUser::tableName() . ' e', 'a.main_user_id=e.id')
+ ->leftJoin(OrderContacts::tableName() . ' f', 'a.order_id=f.order_id and f.contacts_type=1')
+ ->leftJoin(FxUser::tableName() . ' g', 'a.fx_uid=g.uid')
+ ->where($where)
+ ->orderBy('a.create_time DESC')
+ ->offset($offset)
+ ->limit($param['page_size'])
+ ->asArray()
+ ->all();
+ return $result;
+ }
+ }
+
+ /*
+ * 订单列表
+ */
+ public function AdminCommissionList($param)
+ {
+ //where条件
+ $where = ['and', ['!=', 'a.order_status', 1], ['!=', 'a.order_status', 5], ['=', 'a.delete_flag', 0], ['=', 'a.fx_uid', $param['fx_uid']]];
+ if ($param['order_id'] != '') {
+ $where[] = ['like', 'a.order_id', $param['order_id']];
+ }
+ if ($param['order_type_id'] != '') {
+ $where[] = ['=', 'a.category_id', $param['order_type_id']];
+ }
+ if ($param['create_order_start_date'] != '') {
+ $where[] = ['>=', 'a.create_time', $param['create_order_start_date']];
+ }
+ if ($param['create_order_end_date'] != '') {
+ $where[] = ['<', 'a.create_time', date('y-m-d', strtotime("{$param['create_order_end_date']} +1 day"))];
+ }
+ if ($param['order_status_id'] != '') {
+ $where[] = ['=', 'a.order_status', $param['order_status_id']];
+ }
+ if ($param['settlement_start_date'] != '') {
+ $where[] = ['>=', 'a.end_date', date('Y-m-d', strtotime("{$param['settlement_start_date']} -3 day"))];
+ }
+ if ($param['settlement_end_date'] != '') {
+ $where[] = ['<', 'a.end_date', date('Y-m-d', strtotime("{$param['settlement_end_date']} -2 day"))];
+ }
+ $select = [
+ 'a.order_id',
+ 'a.category_id as order_type_id',
+ new Expression("CASE a.category_id
+ WHEN 1 THEN '车票'
+ WHEN 2 THEN '门票'
+ WHEN 3 THEN '酒店'
+ ELSE ''
+ END
+ as order_type_des
+ ")
+ ,
+ 'a.create_time as create_order_date',
+ 'a.total_money as order_price',
+ 'a.order_status as order_status_id',
+ new Expression("CASE a.order_status
+ WHEN 2 THEN '已支付'
+ WHEN 3 THEN '已完成'
+ WHEN 4 THEN '已退款'
+ ELSE ''
+ END
+ as order_status_des
+ ")
+ ,
+ 'date_add(a.end_date,INTERVAL 3 DAY) as settlement_order_date',
+ 'b.total_money as all_commission_money'
+ ];
+ $offset = ($param['current_page'] - 1) * $param['page_size'];
+ $result = self::find()->select($select)
+ ->from(self::tableName() . ' as a')
+ ->leftJoin('fx_commission_info as b', 'a.order_id=b.order_id')
+ ->where($where)
+ ->orderBy('a.create_time DESC')
+ ->offset($offset)
+ ->limit($param['page_size'])
+ ->asArray()
+ ->all();
+ $count = self::find()->select('count(1) as count')->from(self::tableName() . ' as a')->where($where)->asArray()->one();
+ $count = $count['count'];
+ return ['list' => $result, 'count' => $count];
+ }
+
+ /**
+ * Des:获取订单退款信息
+ * Name: getOrderRefund
+ * @param $order_id
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getOrderRefund($order_id)
+ {
+ $select = [
+ 'IFNULL(a.spider_order_id,a.order_id) as order_id',
+ 'b.pro_cate_name',
+ 'a.spider_order_id',
+ 'a.start_date',
+ 'a.start_time',
+ 'a.category_id'
+ ];
+ $result = self::find()
+ ->select($select)
+ ->from(OrderMain::tableName() . ' a')
+ ->innerJoin(ProdCategory::tableName() . ' b', 'a.prod_cate_id = b.pro_cate_id')
+ ->where(['=', 'a.order_id', $order_id])
+ ->asArray()
+ ->one();
+ return $result;
+ }
+
+ /**
+ * Des:判断某个产品是否存在订单
+ * Name: existOrder
+ * @param $param
+ * @return bool
+ * @author 付泓程
+ */
+ public function existOrder($param)
+ {
+ $prod_cate_id = $param['prod_cate_id'];
+ $start_date = $param['start_date'];
+ $run_time = $param['start_time'];
+ $small24 = $param['small24']; //是否小于0 -即提前X天。
+ $select = ['count(order_id) as count'];
+// $sql = "select count(order_id) as count from order_main where prod_cate_id = {$prod_cate_id} and start_date={$start_date} and order_status = 3 and delete_flag=0";
+ $where = ['and', ['=', 'a.prod_cate_id', $prod_cate_id], ['=', 'a.start_date', $start_date], ['=', 'a.order_status', 2], ['=', 'a.delete_flag', 0]];
+ if (!$small24) {
+ $where[] = ['>=', 'a.start_time', $run_time];
+ }
+ $result = self::find()
+ ->select($select)
+ ->from(OrderMain::tableName() . ' a')
+ ->where($where)
+ ->asArray()
+ ->one();
+ $count = $result['count'];
+ if ($count > 0) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * des 获取订单支付详细信息
+ * @param $orderId
+ * @return array
+ */
+ public function getOrderPayInfo($orderId)
+ {
+ $select = [
+ 'a.order_id',
+ 'b.pro_cate_name',
+ new Expression("concat(a.start_date,' ',a.start_time) as 'run_time'"),
+ 'a.category_id',
+ new Expression("(select category_name from base_category WHERE category_id = a.category_id) as category_name"),
+ 'a.prod_cnt',
+ 'a.create_time',
+ 'a.order_status',
+ 'a.total_money',
+ 'c.contacts_name',
+ 'c.contacts_phone'
+ ];
+ $result = self::find()
+ ->select($select)
+ ->from(OrderMain::tableName() . ' a')
+ ->innerJoin(ProdCategory::tableName() . ' b', 'a.prod_cate_id = b.pro_cate_id')
+ ->innerJoin(OrderContacts::tableName() . ' c', 'a.order_id = c.order_id and c.contacts_type=1 ')
+ ->where(['=', 'a.order_id', $orderId])
+ ->asArray()
+ ->one();
+ return $result;
+ }
+
+ /**
+ * Des:订单初始化运营负责人
+ * Name: bindMainCorp
+ * @param $fx_uid
+ * @param $main_user_id
+ * @return int
+ * @author 倪宗锋
+ */
+ public function bindMainCorp($fx_uid, $main_user_id)
+ {
+ $count = self::updateAll(['main_user_id' => $main_user_id], ['=', 'fx_uid', $fx_uid]);
+ return $count;
+ }
+
+ /**
+ * Des:获取酒店订单数据
+ * Name: getHotelOrderInfo
+ * @param $order_id
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getHotelOrderInfo($order_id)
+ {
+ $select = [
+ 'a.order_id',
+ 'c.hotel_id',
+ 'c.room_id',
+ 'a.prod_cnt',
+ 'a.start_date',
+ 'a.end_date',
+ 'a.total_money',
+ 'b.contacts_name',
+ 'b.contacts_phone',
+ 'c.total_details',
+ 'a.system'
+ ];
+ $where = ['=','a.order_id', $order_id];
+ $getInfo = self::find()->select($select)
+ ->from(self::tableName().' a')
+ ->innerJoin(OrderContacts::tableName().' b','a.order_id = b.order_id and b.contacts_type=1')
+ ->innerJoin('order_hotel_extra c','a.order_id = c.main_order_id')
+ ->where($where)
+ ->asArray()
+ ->one();
+ return $getInfo;
+ }
+}
diff --git a/common/models/PayMain.php b/common/models/PayMain.php
new file mode 100644
index 0000000..ef44034
--- /dev/null
+++ b/common/models/PayMain.php
@@ -0,0 +1,77 @@
+ 'ID',
+ 'pay_type' => 'Pay Type',
+ 'amount_money' => 'Amount Money',
+ 'pay_time' => 'Pay Time',
+ 'pay_user' => 'Pay User',
+ 'order_id' => 'Order ID',
+ 'delete_flag' => 'Delete Flag',
+ 'pay_order_id' => 'pay_roder_id',
+ 'order_money' => 'order_money'
+ ];
+ }
+
+ /**
+ * Des:获取支付信息
+ * Name: getPayInfo
+ * @param $oder_id
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getPayInfo($oder_id)
+ {
+ $return = $this->find()
+ ->from(static::tableName())
+ ->where(['=','order_id', $oder_id])
+ ->asArray(true)
+ ->one();
+ return $return;
+ }
+}
diff --git a/common/models/PayRefush.php b/common/models/PayRefush.php
new file mode 100644
index 0000000..0dab727
--- /dev/null
+++ b/common/models/PayRefush.php
@@ -0,0 +1,129 @@
+ 'ID',
+ 'order_id' => 'Order ID',
+ 'pay_order_id' => 'pay_order_id',
+ 'pay_type' => 'Pay Type',
+ 'amount_money' => 'Amount Money',
+ 'refush_money' => 'refush_money',
+ 'fx_uid' => 'Fx Uid',
+ 'sh_uid' => 'Sh Uid',
+ 'status' => 'Status',
+ 'create_time' => 'Create Time',
+ 'refund_time' => 'Refund Time',
+ 'delete_flag' => 'Delete Flag',
+ ];
+ }
+
+ /**
+ * Des:根据订单ID获取退款信息
+ * Name: getInfoByOrderId
+ * @param $orderId
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getInfoByOrderId($orderId)
+ {
+ $return = $this->find()
+ ->from(static::tableName())
+ ->where(['=', 'order_id', $orderId])
+ ->asArray(true)
+ ->one();
+ return $return;
+ }
+
+ /**
+ * Des:根据ID获取退款信息
+ * Name: getInfoByOrderId
+ * @param $id
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getInfoById($id)
+ {
+ $return = $this->find()
+ ->from(static::tableName())
+ ->where(['=', 'id', $id])
+ ->asArray(true)
+ ->one();
+ return $return;
+ }
+
+ /**
+ * Des:获取所有未退款的退款申请记录
+ * Name: getAllUnPay
+ * @author 倪宗锋
+ */
+ public function getUnPayIds()
+ {
+ $return = $this->find()->select(['id'])
+ ->from(static::tableName())
+ ->where(['=', 'status', 1])
+ ->asArray(true)
+ ->all();
+ return $return;
+ }
+
+ /**
+ * Des:修改退款状态
+ * Name: updateStatus
+ * @param $id
+ * @param $status
+ * @return int
+ * @author 倪宗锋
+ */
+ public function updateStatus($id, $status)
+ {
+ $flag = self::updateAll(['status' => $status, 'refund_time' => date('Y-m-d H:i:s')], ['=', 'id', $id]);
+ return $flag;
+ }
+}
diff --git a/common/models/ProdCategory.php b/common/models/ProdCategory.php
new file mode 100644
index 0000000..e64d5f1
--- /dev/null
+++ b/common/models/ProdCategory.php
@@ -0,0 +1,802 @@
+ 100],
+ [['show_img', 'sign', 'prod_des'], 'string', 'max' => 255],
+ [['memo',], 'string', 'max' => 65536],
+ [['update_user', 'close_sale_time'], 'string', 'max' => 50],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'pro_cate_id' => 'Pro Cate ID',
+ 'pro_cate_name' => 'Pro Cate Name',
+ 'category_id' => 'Category ID',
+ 'show_price' => 'Show Price',
+ 'show_img' => 'Show Img',
+ 'sign' => 'sign',
+ 'prod_des' => 'prod_des',
+ 'sales_count' => 'Sales Count',
+ 'memo' => 'Memo',
+ 'commission' => 'Commission',
+ 'create_user_id' => 'Create User ID',
+ 'is_recom' => 'Is Recom',
+ 'create_time' => 'Create Time',
+ 'update_time' => 'Update Time',
+ 'delete_flag' => 'Delete Flag',
+ 'update_user' => 'Update User',
+ 'address' => 'Address',
+ 'bus_ticket_id' => 'Bus Ticket ID',
+ 'bus_line_type' => 'Bus Line Type',
+ ];
+ }
+
+ /**
+ * Function Description:热销商品推荐10个
+ * Function Name: GetHotProd
+ * @param string $searchStr
+ *
+ * @return array|\yii\db\ActiveRecord[]
+ *
+ * @author 娄梦宁
+ */
+ public function GetHotProd($searchStr = '')
+ {
+ $where = [
+ 'and',
+ ['<>', 'show_img', ''],
+ ['=', 'a.delete_flag', 0],
+ ['=', 'b.delete_flag', 0],
+ ['=', 'b.system', 1]
+ ];
+ if ($searchStr != '') {
+ $where[] = ['like', 'pro_cate_name', $searchStr];
+ }
+ $result = self::find()->select(['pro_cate_id', 'sales_count', "IFNULL(prod_des, '') prod_des", 'pro_cate_name', 'if(category_id=1,(if(sign is null,category_id,1000)),category_id) as category_id', 'show_price', "concat(show_img,'.','min.jpg') as show_img"])
+ ->from(self::tableName() . ' a')
+ ->innerJoin('cms_category_prod b', 'a.pro_cate_id=b.prod_cate_id')
+ ->where($where)
+ ->orderBy(['sales_count' => SORT_DESC, 'pro_cate_id' => SORT_DESC])
+ ->limit(10)
+ ->asArray()
+ ->all();
+ foreach($result as &$v){
+ $v['show_price'] = $this->dealFloat($v['show_price']);
+ }
+ return $result;
+ }
+
+ /**
+ * Function Description:推荐产品列表
+ * Function Name: GetRecommendProd
+ * @param string $where
+ *
+ * @return array|\yii\db\ActiveRecord[]
+ *
+ * @author 娄梦宁
+ */
+ public function GetRecommendProd($where = '')
+ {
+ if ($where == '') {
+ $result = self::find()->select(['pro_cate_id', 'sales_count', 'pro_cate_name', "IFNULL(prod_des, '') prod_des", 'if(category_id=1,(if(sign is null,category_id,1000)),category_id) as category_id', 'show_price', "concat(show_img,'.','min.jpg') as show_img"])
+ ->from(self::tableName() . ' a')
+ ->leftJoin('cms_category_prod b', 'a.pro_cate_id=b.prod_cate_id and b.delete_flag=0')
+ ->where(['and', ['=', 'is_recom', 1], ['!=', 'show_img', ''], ['=', 'a.delete_flag', 0], ['=', 'b.system', 1]])
+ ->orderBy(['pro_cate_id' => SORT_DESC])
+ ->asArray()
+ ->all();
+ } else {
+ $result = self::find()->select(['pro_cate_id', 'sales_count', 'pro_cate_name', "IFNULL(prod_des, '') prod_des", 'if(category_id=1,(if(sign is null,category_id,1000)),category_id) as category_id', 'show_price', "concat(show_img,'.','min.jpg') as show_img"])
+ ->from(self::tableName() . ' a')
+ ->leftJoin('cms_category_prod b', 'a.pro_cate_id=b.prod_cate_id and b.delete_flag=0')
+ ->where(['and', ['=', 'is_recom', 1], ['!=', 'show_img', ''], ['=', 'a.delete_flag', 0], ['=', 'b.system', 1]])
+ ->andWhere(['like', 'pro_cate_name', $where])
+ ->orderBy(['pro_cate_id' => SORT_DESC])
+ ->asArray()
+ ->all();
+ }
+ foreach($result as &$v){
+ $v['show_price'] = $this->dealFloat($v['show_price']);
+ }
+ return $result;
+ }
+
+ /**
+ * Function Description:首页列表查询产品
+ * Function Name: GetListProd
+ * @param $prod_id
+ * @param string $where
+ *
+ * @return array|\yii\db\ActiveRecord[]
+ *
+ * @author 娄梦宁
+ */
+ public function GetListProd($prod_id, $where = '')
+ {
+ if ($where == '') {
+ $result = self::find()->select(['pro_cate_id', 'sales_count', 'pro_cate_name', "IFNULL(prod_des, '') prod_des", 'if(category_id=1,(if(sign is null,category_id,1000)),category_id) as category_id', 'show_price', "concat(show_img,'.','min.jpg') as show_img"])
+ ->from(self::tableName() . ' a')
+ ->leftJoin('cms_category_prod b', 'a.pro_cate_id=b.prod_cate_id and b.delete_flag=0')
+ ->where(['and', ['=', 'b.cms_cate_id', $prod_id], ['<>', 'a.show_img', ''], ['=', 'a.delete_flag', 0]])
+ ->orderBy(['show_sort' => SORT_ASC, 'a.pro_cate_id' => SORT_DESC])
+ ->asArray()
+ ->all();
+ } else {
+ $result = self::find()->select(['pro_cate_id', 'sales_count', 'pro_cate_name', "IFNULL(prod_des, '') prod_des", 'if(category_id=1,(if(sign is null,category_id,1000)),category_id) as category_id', 'show_price', "concat(show_img,'.','min.jpg') as show_img"])
+ ->from(self::tableName() . ' a')
+ ->leftJoin('cms_category_prod b', 'a.pro_cate_id=b.prod_cate_id and b.delete_flag=0')
+ ->where(['and', ['=', 'b.cms_cate_id', $prod_id], ['<>', 'a.show_img', ''], ['=', 'a.delete_flag', 0]])
+ ->andWhere(['like', 'pro_cate_name', $where])
+ ->orderBy(['show_sort' => SORT_ASC, 'a.pro_cate_id' => SORT_DESC])
+ ->asArray()
+ ->all();
+ }
+ foreach($result as &$v){
+ $v['show_price'] = $this->dealFloat($v['show_price']);
+ }
+ return $result;
+ }
+
+ /**
+ * Function Description:非巴士产品获取详情
+ * Function Name: getProdDetail
+ * @param $pro_cate_id
+ *
+ * @return array|null|\yii\db\ActiveRecord
+ *
+ * @author 娄梦宁
+ */
+ public function getProdDetail($pro_cate_id)
+ {
+ $result = self::find()->select(['pro_cate_id', 'pro_cate_name', "IFNULL(prod_des, '') prod_des", 'category_id', 'show_img', 'memo booking_notice', 'sign', 'show_price', 'close_sale_time',
+ "(select category_name from cms_category where cms_category_id =(select cms_cate_id from cms_category_prod where prod_cate_id=$pro_cate_id limit 1)) as category_name"])
+ ->from(self::tableName())
+ ->where(['and', ['=', 'pro_cate_id', $pro_cate_id], ['=', 'delete_flag', 0]])
+ ->asArray()
+ ->one();
+ $result['show_price'] = $this->dealFloat($result['show_price']);
+ return $result;
+ }
+
+ /**
+ * Des:获取产品详细信息
+ * Name: getProdInfo
+ * @param $pro_cate_id
+ * @return array|null|\yii\db\ActiveRecord
+ * @author 倪宗锋
+ */
+ public function getProdCateInfo($pro_cate_id)
+ {
+ $result = self::find()
+ ->from(self::tableName())
+ ->where(['=', 'pro_cate_id', $pro_cate_id])
+ ->asArray()
+ ->one();
+ return $result;
+ }
+
+ /**
+ * Function Description:巴士产品获取详情
+ * Function Name: getBusProdDetail
+ * @param $pro_cate_id
+ *
+ * @return array|null|\yii\db\ActiveRecord
+ *
+ * @author 娄梦宁
+ */
+ public function getBusProdDetail($pro_cate_id)
+ {
+ $result = self::find()->select(['pro_cate_id', 'pro_cate_name', "IFNULL(prod_des, '') prod_des", 'category_id', 'sign', 'show_img', 'IFNULL(close_sale_time,24) as close_sale_time', "(select category_name from cms_category where cms_category_id =(select cms_cate_id from cms_category_prod where prod_cate_id=$pro_cate_id limit 1)) as category_name"
+ , 'b.start_area_name', 'b.start_area_id', 'b.start_res_name', 'b.end_res_name', 'b.end_area_name', 'b.end_area_id', 'memo booking_notice'])
+ ->from(self::tableName() . ' as a')
+ ->leftJoin('bus_ticket b', 'a.bus_ticket_id=b.ticket_id')
+ ->where(['and', ['=', 'pro_cate_id', $pro_cate_id]])
+ ->asArray()
+ ->one();
+ return $result;
+ }
+
+ /*
+ * 后台产品列表
+ */
+ public function AdminGetList($param)
+ {
+ $where = ['and', ['=', 'a.delete_flag', 0]];
+ if ($param['category_id'] != '') {
+ $where[] = ['=', 'b.cms_cate_id', $param['category_id']];
+ }
+ if ($param['pro_cate_name'] != '') {
+ $where[] = ['like', 'pro_cate_name', $param['pro_cate_name']];
+ }
+ if ($param['is_recom'] != '') {
+ $where[] = ['=', 'is_recom', $param['is_recom']];
+ }
+ $offset = ($param['current_page'] - 1) * $param['page_size'];
+ $select = [
+ 'pro_cate_id',
+ 'a.category_id',
+ "if(a.category_id=1,if(a.sign is not null,concat(c.category_name,'(主线路)'),concat(c.category_name,'(子线路)')),c.category_name) as base_category",
+ 'pro_cate_name', 'close_sale_time',
+ 'memo', "IFNULL(prod_des, '') prod_des",
+ 'commission', 'show_img',
+ 'is_recom as is_recom_id',
+ 'if(is_recom=1,"已推荐","未推荐") as is_recom'
+ , "(select 1) as commission_way_id", "(select '按金额') as commission_way",
+ "ifnull((select category_name from cms_category where cms_category_id =(select cms_cate_id from cms_category_prod where prod_cate_id=a.pro_cate_id limit 1)),'') as category_name"
+ , "ifnull(b.cms_cate_id,-1) as cms_category_id"
+ ];
+ $result = self::find()->select($select)
+ ->from(self::tableName() . ' a')
+ ->leftJoin('cms_category_prod as b', 'b.prod_cate_id = a.pro_cate_id')
+ ->innerJoin(BaseCategory::tableName() . ' c', 'c.category_id = a.category_id')
+ ->where($where)
+ ->groupBy('a.pro_cate_id')
+ ->orderBy('a.pro_cate_id DESC')
+ ->offset($offset)
+ ->limit((int)$param['page_size'])
+ ->asArray()
+ ->all();
+
+
+ $result1 = self::find()->select('count(1) as count')
+ ->from(self::tableName() . ' a')
+ ->leftJoin('cms_category_prod as b', 'b.prod_cate_id=a.pro_cate_id')
+ ->asArray()
+ ->where($where)
+ ->one();
+ $result1 = $result1['count'];
+ return ['list' => $result, 'count' => $result1];
+ }
+
+ /*
+ * 产品推荐
+ */
+ public function Recommend($pro_cate_id)
+ {
+ $is_recom = self::find()->select(["is_recom"])->from(self::tableName())->where(['=', 'pro_cate_id', $pro_cate_id])->asArray()->one();
+ if ($is_recom['is_recom'] == 1) {
+ $count = self::updateAll(['is_recom' => 0], ['=', 'pro_cate_id', $pro_cate_id]);
+ } else {
+ $count = self::updateAll(['is_recom' => 1], ['=', 'pro_cate_id', $pro_cate_id]);
+ }
+ return $count;
+ }
+
+ /*
+ * 添加产品
+ */
+ public function addProd($param)
+ {
+ $values = [
+ 'category_id' => $param['category_id'],
+ 'pro_cate_name' => $param['pro_cate_name'],
+ 'memo' => $param['memo'],
+ 'sales_count' => rand(1, 10),
+ 'show_img' => $param['show_img'],
+ 'create_time' => date('Y-m-d H:i:s'),
+ 'prod_des' => $param['prod_des'],
+ 'close_sale_time' => $param['close_sale_time'] //截止售卖时间 2017-05-18 fuhc
+ ];
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+ $this->attributes = $values;
+ $res = $this->insert();
+ if (!$res) {
+ throw new Exception('添加出错');
+ }
+ $transaction->commit();
+ return true;
+ } catch (Exception $e) {
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+ /*
+ * 修改show price
+ */
+ public function changeShowPrice($pro_cate_id)
+ {
+ //查当前产品的子产品最低价
+ $show_price = ProdMain::find()->select(['min(prod_price) as price'])->from('prod_main')->where(['and', ['=', 'delete_flag', '0'], ['=', 'prod_cate_id', $pro_cate_id]])->asArray()->one();
+ $show_price = $show_price['price'];
+ $count = self::updateAll(['show_price' => $show_price], ['and', ['=', 'pro_cate_id', $pro_cate_id]]);
+ return $count;
+ }
+
+ /*
+ * 自定义佣金
+ */
+ public function DefineCommission($pro_cate_id, $commission)
+ {
+ $count = self::updateAll(['commission' => $commission], ['and', ['=', 'pro_cate_id', $pro_cate_id]]);
+ return $count;
+ }
+
+ /*
+ * 后台修改产品信息
+ */
+ public function uptAdminProd($param)
+ {
+ $values = [
+ 'category_id' => $param['category_id'],
+ 'pro_cate_name' => $param['pro_cate_name'],
+ 'memo' => $param['memo'],
+ 'show_img' => $param['show_img'],
+ 'prod_des' => $param['prod_des'],
+ 'update_time' => date('Y-m-d H:i:s'),
+ 'close_sale_time' => $param['close_sale_time'] //截止售卖时间 2017-05-18 fuhc
+ ];
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+ $uptOne = self::findOne(['pro_cate_id' => $param['pro_cate_id']]);
+ $uptOne->attributes = $values;
+ $res = $uptOne->update();
+ if ($res === false) {
+ throw new Exception('添加出错');
+ }
+ $transaction->commit();
+ return true;
+ } catch (Exception $e) {
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+ /*
+ * 产品增量
+ */
+ public function addCount($pro_cate_id, $cnt)
+ {
+ $sql = '' . "UPDATE prod_category
+ set sales_count=sales_count+$cnt
+ where pro_cate_id = $pro_cate_id
+ ";
+ $res = $this->getDb()->createCommand($sql)->execute();
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Des:
+ * Name: getEntranceTicket
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getEntranceTicket()
+ {
+ $result = self::find()
+ ->from(self::tableName())
+ ->where(['and', ['<>', 'sign', ''], ['=', 'category_id', 2], ['=', 'delete_flag', 0]])
+ ->indexBy('sign')
+ ->asArray()
+ ->all();
+ return $result;
+ }
+
+ /**
+ * Des:同步门票数据
+ * Name: addEntranceTicketFormCs
+ * @param $prodArr
+ * @return int
+ * @throws \yii\db\Exception
+ * @author 倪宗锋
+ */
+ public function addEntranceTicketFormCs($prodArr)
+ {
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+ /**添加产品主表数据***************/
+ $prodValues = [];
+ $prodKeys = [
+ 'pro_cate_name',
+ 'category_id',
+ 'create_time',
+ 'sign',
+ ];
+ foreach ($prodArr as $key => $val) {
+ $prodVal = [];
+ $prodVal[] = $val['name'];
+ $prodVal[] = 2;
+ $prodVal[] = date('Y-m-d H:i:s');
+ $prodVal[] = $key;
+ $prodValues[] = $prodVal;
+ }
+ $count = Yii::$app->db->createCommand()->batchInsert('prod_category', $prodKeys, $prodValues)->execute();
+ if ($count == 0) {
+ $transaction->rollBack();
+ return false;
+ }
+ /**获取新添加的产品主表数据及其ID**/
+ $signArr = array_keys($prodArr);
+ $result = self::find()
+ ->from(self::tableName())
+ ->where(['and', ['in', 'sign', $signArr], ['=', 'category_id', 2]])
+ ->indexBy('sign')
+ ->asArray()
+ ->all();
+ /**将数据产褥prod_main表中*/
+ $prodMainValues = [];
+ $prodMainKeys = ['prod_cate_id', 'prod_name', 'create_time', 'bus_id'];
+ foreach ($result as $key => $val) {
+ if (!empty($prodArr[$val['sign']]['sub_ticket']) && count($prodArr[$val['sign']]['sub_ticket']) > 0) {
+ $subTicket = $prodArr[$val['sign']]['sub_ticket'];
+ foreach ($subTicket as $subVal) {
+ $prodMainVal = [];
+ $prodMainVal[] = $val['pro_cate_id'];
+ $prodMainVal[] = $subVal['prod_name'];
+ $prodMainVal[] = date('Y-m-d H:i:s');
+ $prodMainVal[] = $subVal['prod_id'];
+ $prodMainValues[] = $prodMainVal;
+ }
+
+ }
+ }
+ $count = Yii::$app->db->createCommand()->batchInsert('prod_main', $prodMainKeys, $prodMainValues)->execute();
+
+ if ($count == 0) {
+ $transaction->rollBack();
+ return false;
+ }
+ $transaction->commit();
+ return true;
+ } catch (Exception $e) {
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+ /**
+ * Des: 删除门票数据
+ * Name: delEntranceTicketFormCs
+ * @author 倪宗锋
+ */
+ public function delEntranceTicketFormCs($prodArr)
+ {
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+ $values = [
+ 'delete_flag' => 1
+ ];
+ $signArr = array_keys($prodArr);
+ $res = self::updateAll($values, ['in', 'sign', $signArr]);
+ if ($res === false) {
+ throw new Exception('添加出错');
+ }
+ $transaction->commit();
+ return true;
+ } catch (Exception $e) {
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+ /**
+ * Des:修改订单状态为激活
+ * Name: interEntranceTicketFormCs
+ * @param $new_bus_arr_inter
+ * @return bool
+ * @throws \yii\db\Exception
+ * @author 倪宗锋
+ */
+ public function interEntranceTicketFormCs($new_bus_arr_inter)
+ {
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+ $values = [
+ 'delete_flag' => 0
+ ];
+ $signArr = array_keys($new_bus_arr_inter);
+ $res = self::updateAll($values, ['in', 'sign', $signArr]);
+ if ($res === false) {
+ throw new Exception('编辑出错');
+ }
+ $transaction->commit();
+ return true;
+ } catch (Exception $e) {
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+ /**
+ * Des:每日增加产品的销售量 每月1号重置产品的销售量
+ * Name: setSaleCnt
+ * @param $day
+ * @return bool
+ * @throws \yii\db\Exception
+ * @author 倪宗锋
+ */
+ public function setSaleCnt($day)
+ {
+ if ($day == 1) {
+ $values = [
+ 'sales_count' => new Expression("1+ROUND(RAND()*10,0)")
+ ];
+ } else {
+ $values = [
+ 'sales_count' => new Expression("sales_count+sales_count*0.05+1+ROUND(RAND()*5,0)")
+ ];
+ }
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+
+ $res = self::updateAll($values);
+ if ($res === false) {
+ throw new Exception('添加出错');
+ }
+ $transaction->commit();
+ return true;
+ } catch (Exception $e) {
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+ /**
+ * Des:LBS获取产品列表
+ * Name: getLBSListByCmsCate
+ * @param $point
+ * @param $cms_cate_id
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getLBSListByCmsCate($point, $cms_cate_id)
+ {
+ $pointArr = explode(',', $point);//经纬度坐标
+ if (empty($pointArr['0']) || empty($pointArr['1'])) {
+ return [];
+ }
+ $longitude = $pointArr['0'];
+ $latitude = $pointArr['1'];
+ $sql = '' . "SELECT round(if(a.start_lbs>a.end_lbs,a.end_lbs,a.start_lbs),3) 'lbs', b.pro_cate_id,b.sales_count,
+ b.pro_cate_name,IFNULL(prod_des, '') prod_des,if(category_id=1,(if(sign is null,category_id,1000)),category_id) as category_id
+ ,show_price,concat(show_img,'.','min.jpg') as show_img
+ from (
+ select ticket_id,line_type,sqrt(
+ ((({$longitude}-start_res_longitude)*PI()*12656*cos((($latitude+start_res_latitude)/2)*PI()/180)/180)
+ * (({$longitude}-start_res_longitude)*PI()*12656*cos ((($latitude+start_res_latitude)/2)*PI()/180)/180))
+ + ((($latitude-start_res_latitude)*PI()*12656/180)
+ * (($latitude-start_res_latitude)*PI()*12656/180))
+ )/2 as start_lbs,
+ sqrt(
+ ((({$longitude}-end_res_longitude)*PI()*12656*cos((($latitude+end_res_latitude)/2)*PI()/180)/180)
+ *(({$longitude}-end_res_longitude)*PI()*12656*cos ((($latitude+end_res_latitude)/2)*PI()/180)/180)
+ )+((($latitude-end_res_latitude)*PI()*12656/180)
+ *(($latitude-end_res_latitude)*PI()*12656/180))
+ )/2 as end_lbs,
+ start_res_longitude, start_res_latitude,end_res_longitude,end_res_latitude
+ from bus_ticket where
+ start_res_longitude is not null and end_res_longitude is not NULL
+ and start_res_latitude is not null and end_res_latitude is not NULL
+ ) a
+ JOIN prod_category b on a.ticket_id=b.bus_ticket_id
+ JOIN cms_category_prod c on b.pro_cate_id = c.prod_cate_id
+ WHERE b.sign is NULL and c.cms_cate_id={$cms_cate_id} and b.show_img <> '' and b.delete_flag=0
+ ORDER BY lbs
+ LIMIT 10 ";
+ $result = Yii::$app->getDb()->createCommand($sql)->queryAll();
+ foreach($result as &$v){
+ $v['show_price'] = $this->dealFloat($v['show_price']);
+ }
+ return $result;
+ }
+
+
+ /**
+ * Des:
+ * Name: getEntranceHotel
+ * @return array
+ * @author 付泓程
+ */
+ public function getEntranceHotel()
+ {
+ $result = self::find()
+ ->from(self::tableName())
+ ->where(['and', ['<>', 'sign', ''], ['=', 'category_id', 3]])
+ ->indexBy('sign')
+ ->asArray()
+ ->all();
+ return $result;
+ }
+
+
+ /**
+ * Des:同步酒店数据
+ * Name: addEntranceHotelFormCs
+ * @param $prodArr
+ * @return bool
+ * @throws \yii\db\Exception
+ * @author 付泓程
+ */
+ public function addEntranceHotelFormCs($prodArr)
+ {
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+ /**添加产品主表数据***************/
+ $prodValues = [];
+ $prodKeys = [
+ 'pro_cate_name',
+ 'category_id',
+ 'create_time',
+ 'sign',
+ ];
+ foreach ($prodArr as $key => $val) {
+ $prodVal = [];
+ $prodVal[] = $val['name'];
+ $prodVal[] = 3;
+ $prodVal[] = date('Y-m-d H:i:s');
+ $prodVal[] = $key;
+ $prodValues[] = $prodVal;
+ }
+ $count = Yii::$app->db->createCommand()->batchInsert('prod_category', $prodKeys, $prodValues)->execute();
+ if ($count == 0) {
+ $transaction->rollBack();
+ return false;
+ }
+ /**获取新添加的产品主表数据及其ID**/
+ $signArr = array_keys($prodArr);
+ $result = self::find()
+ ->from(self::tableName())
+ ->where(['and', ['in', 'sign', $signArr], ['=', 'category_id', 3]])
+ ->indexBy('sign')
+ ->asArray()
+ ->all();
+ /**将数据插入prod_main表中*/
+ $prodMainValues = [];
+ $prodMainKeys = ['prod_cate_id', 'prod_name', 'create_time', 'bus_id'];
+ foreach ($result as $key => $val) {
+ if (!empty($prodArr[$val['sign']]['sub_ticket']) && count($prodArr[$val['sign']]['sub_ticket']) > 0) {
+ $subTicket = $prodArr[$val['sign']]['sub_ticket'];
+ foreach ($subTicket as $subVal) {
+ $prodMainVal = [];
+ $prodMainVal[] = $val['pro_cate_id'];
+ $prodMainVal[] = $subVal['prod_name'];
+ $prodMainVal[] = date('Y-m-d H:i:s');
+ $prodMainVal[] = $subVal['prod_id'];
+ $prodMainValues[] = $prodMainVal;
+ }
+
+ }
+ }
+ $count = Yii::$app->db->createCommand()->batchInsert('prod_main', $prodMainKeys, $prodMainValues)->execute();
+
+ if ($count == 0) {
+ $transaction->rollBack();
+ return false;
+ }
+ $transaction->commit();
+ return true;
+ } catch (Exception $e) {
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+
+ /**
+ * Des: 删除酒店数据
+ * Name: delEntranceTicketFormCs
+ * @author 付泓程
+ */
+ public function delEntranceHotelFormCs($prodArr)
+ {
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+ $values = [
+ 'delete_flag' => 1
+ ];
+ $signArr = array_keys($prodArr);
+ $res = self::updateAll($values, ['in', 'sign', $signArr]);
+ if ($res === false) {
+ throw new Exception('删除出错');
+ }
+ $transaction->commit();
+ return true;
+ } catch (Exception $e) {
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+
+ /**
+ * Des:修改订单状态为激活
+ * Name: interEntranceHotelFormCs
+ * @param $new_bus_arr_inter
+ * @return bool
+ * @throws \yii\db\Exception
+ * @author 付泓程
+ */
+ public function interEntranceHotelFormCs($new_bus_arr_inter)
+ {
+ $transaction = Yii::$app->db->beginTransaction();
+ try {
+ $values = [
+ 'delete_flag' => 0
+ ];
+ $signArr = array_keys($new_bus_arr_inter);
+ $res = self::updateAll($values, ['in', 'sign', $signArr]);
+ if ($res === false) {
+ throw new Exception('编辑出错');
+ }
+ $transaction->commit();
+ return true;
+ } catch (Exception $e) {
+ $transaction->rollBack();
+ return false;
+ }
+ }
+
+ /**
+ * Function Description:处理价格
+ * Function Name: dealFloat
+ * @param $float
+ *
+ * @return float
+ *
+ * @author LUOCJ
+ */
+ public function dealFloat($float)
+ {
+ $int = floor($float);
+ if ($float - $int == 0) {
+ $float = $int;
+ }
+ return $float;
+ }
+}
diff --git a/common/models/ProdMain.php b/common/models/ProdMain.php
new file mode 100644
index 0000000..526d6cd
--- /dev/null
+++ b/common/models/ProdMain.php
@@ -0,0 +1,286 @@
+ 100],
+ [['create_user', 'update_user'], 'string', 'max' => 50],
+ [['bus_id'], 'string', 'max' => 255],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'prod_id' => 'Prod ID',
+ 'prod_cate_id' => 'Prod Cate ID',
+ 'prod_name' => 'Prod Name',
+ 'prod_price' => 'Prod Price',
+ 'create_user' => 'Create User',
+ 'create_time' => 'Create Time',
+ 'update_time' => 'Update Time',
+ 'delete_flag' => 'Delete Flag',
+ 'update_user' => 'Update User',
+ 'bus_id' => 'Bus ID',
+ ];
+ }
+
+ /**
+ * Function Description:产品详情获取子产品数组
+ * Function Name: getProdArr
+ * @param $pro_cate_id
+ *
+ * @return array|null|\yii\db\ActiveRecord
+ *
+ * @author 娄梦宁
+ */
+ public function getProdArr($pro_cate_id)
+ {
+ $result = self::find()->select(['prod_name', 'prod_price', 'prod_id', 'bus_id', '(select 100) as prod_count', 'commission'])
+ ->from(self::tableName())
+ ->where(['and', ['=', 'prod_cate_id', $pro_cate_id], ['=', 'delete_flag', 0]])
+ ->asArray()
+ ->all();
+ if (empty($result['0'])) {
+ return [];
+ } else {
+ foreach ($result as &$v) {
+ $v['prod_price'] = $this->dealFloat($v['prod_price']);
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Des:获取订单总价格
+ * Name: getTotalMoney
+ * @param $params array 多为数组 产品ID和数量
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getTotalMoney($params)
+ {
+ $prod_id = [];
+ $sqlCase = '';
+ foreach ($params as $val) {
+ $sqlCase .= " WHEN {$val['prod_id']} THEN prod_price*{$val['prod_count']} ";
+ $prod_id[] = $val['prod_id'];
+ }
+ $prodId = implode(',', $prod_id);
+
+ $sql = '' . "SELECT
+ SUM(CASE prod_id
+ {$sqlCase}
+ ELSE 0
+ END)
+ from prod_main
+ where prod_id in ({$prodId})
+ ";
+ $result = Yii::$app->db->createCommand($sql)->queryScalar();
+ return $result;
+ }
+
+ /**
+ * Function Description:获取票种id
+ * Function Name: getTicketId
+ * @param $pro_cate_id
+ *
+ * @return array|null|\yii\db\ActiveRecord
+ *
+ * @author 娄梦宁
+ */
+ public function getTicketId($pro_cate_id)
+ {
+ $where = ['and'];
+ $where[] = ['=', 'prod_cate_id', $pro_cate_id];
+ $where[] = ['=', 'delete_flag', 0];
+ $result = self::find()->select(['bus_id', 'prod_price', 'prod_id', 'prod_name'])
+ ->from(self::tableName())
+ ->where($where)
+ ->orderBy('prod_id')
+ ->asArray()
+ ->all();
+ return $result;
+ }
+
+ /**
+ * Function Description:查询起始站点
+ * Function Name: getStation
+ * @param $prod_id
+ *
+ * @return mixed
+ *
+ * @author 娄梦宁
+ */
+ public function getStation($prod_id)
+ {
+ $result = self::find()->select(["concat(start_res_name,' - ',end_res_name) as station_str"])
+ ->from(self::tableName() . ' as a')
+ ->leftJoin('bus_ticket as b', 'a.bus_id=b.ticket_id')
+ ->where(['a.prod_id' => $prod_id])
+ ->asArray()
+ ->one();
+ return $result['station_str'];
+ }
+
+ /**
+ * Function Description:子产品表添加(只能添加非巴士产品)
+ * Function Name: addProdMain
+ * @param $param
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function addProdMain($param)
+ {
+ $transaction = Yii::$app->db->beginTransaction();
+ if ($param['category_id'] != 1) {
+ foreach ($param['price_type'] as $val) {
+ $values = [
+ 'prod_cate_id' => $param['prod_cate_id'],
+ 'prod_name' => $val['price_type_name'],
+ 'prod_price' => $val['price_type_price'],
+ 'create_time' => date('Y-m-d H:i:s'),
+ ];
+ $prod_main = clone $this;
+ $prod_main->attributes = $values;
+ $res = $prod_main->insert();
+ if (!$res) {
+ $transaction->rollBack();
+ return false;
+ }
+ }
+ }
+ $transaction->commit();
+ return true;
+ }
+
+ /*
+ * 修改子产品表
+ */
+ public function uptCmsProd($prod_arr, $pro_cate_id)
+ {
+ if ($prod_arr['prod_id'] == 0) {
+ $value = [
+ 'prod_name' => $prod_arr['price_type_name'],
+ 'prod_price' => $prod_arr['price_type_price'],
+ 'prod_cate_id' => $pro_cate_id,
+ 'create_time' => date('Y-m-d H:i:s')
+ ];
+ $this->attributes = $value;
+ $res = $this->insert();
+ if (!$res) {
+ return false;
+ }
+ } else {
+ $count = self::updateAll(['prod_name' => $prod_arr['price_type_name'], 'prod_price' => $prod_arr['price_type_price']], ['=', 'prod_id', $prod_arr['prod_id']]);
+ if ($count === false) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /*
+ * 获取产品的子产品数组
+ */
+ public function getIdArr($pro_cate_id)
+ {
+ $arr = self::find()->select('prod_id')->from(self::tableName())->where(['prod_cate_id' => $pro_cate_id])->indexBy('prod_id')->asArray()->all();
+ return $arr;
+ }
+
+ public function delCount($prod_id)
+ {
+ $count = self::updateAll(['delete_flag' => 1], ['=', 'prod_id', $prod_id]);
+ return $count;
+ }
+
+
+ /*
+ * Des:设置产品佣金 (根据prod_cate_id)
+ * Name: setProdCommissionByCateId
+ * @param $param
+ * @return int
+ * @author 付泓程
+ */
+ public function setProdCommissionByCateId($param)
+ {
+ $commission = $param['commission'];
+ $prod_cate_id = $param['prod_cate_id'];
+ $count = $this->updateAll(['commission' => $commission], ['and', ['=', 'prod_cate_id', $prod_cate_id], ['=', 'delete_flag', '0']]);
+ return $count;
+ }
+
+ /*
+ * Des:设置产品佣金 (根据prod_id)
+ * Name: setProdCommissionByProdId
+ * @param $param
+ * @return int
+ * @author 付泓程
+ */
+ public function setProdCommissionByProdId($param)
+ {
+ $commission = $param['commission'];
+ $prod_id = $param['prod_id'];
+ $count = $this->updateAll(['commission' => $commission], ['and', ['=', 'prod_id', $prod_id], ['=', 'delete_flag', '0']]);
+ return $count;
+ }
+
+ /**
+ * Function Description:处理价格
+ * Function Name: dealFloat
+ * @param $float
+ *
+ * @return float
+ *
+ * @author LUOCJ
+ */
+ public function dealFloat($float)
+ {
+ $int = floor($float);
+ if ($float - $int == 0) {
+ $float = $int;
+ }
+ return $float;
+ }
+}
diff --git a/common/models/ShUser.php b/common/models/ShUser.php
new file mode 100644
index 0000000..077af5d
--- /dev/null
+++ b/common/models/ShUser.php
@@ -0,0 +1,115 @@
+ 20],
+ [['phone'], 'unique'],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'uid' => 'Uid',
+ 'phone' => 'Phone',
+ 'status' => 'Status',
+ 'reg_time' => 'Reg Time',
+ 'last_login' => 'Last Login',
+ ];
+ }
+
+ /**
+ * Des:根据手机号获取用户ID 没有则注册一个
+ * Name: getUidByPhone
+ * @param $phone
+ * @return int|mixed
+ * @author 倪宗锋
+ */
+ public function getUidByPhone($phone)
+ {
+ $info = $this->getUserInfoByPhone($phone);
+ if (empty($info['uid'])) {
+ $this->addUser(['phone' => $phone]);
+ $info = $this->getUserInfoByPhone($phone);
+ }
+ if (empty($info['uid'])) {
+ return 0;
+ }
+ return $info['uid'];
+ }
+
+ /**
+ * Des:根据手机号获取用户的信息
+ * Name: getUserInfoByPhone
+ * @param $phone
+ * @return array
+ * @author 倪宗锋
+ */
+ public function getUserInfoByPhone($phone)
+ {
+ $info = self::find()
+ ->where(['=', 'phone', $phone])
+ ->asArray()
+ ->one();
+ if (empty($info['uid'])) {
+ return [];
+ }
+ return $info;
+ }
+
+ /**
+ * Des: 添加用户
+ * Name: addUser
+ * @param $param
+ * @return bool
+ * @author 倪宗锋
+ */
+ public function addUser($param)
+ {
+ $this->setAttributes($param);
+ $return = $this->insert(true);
+ return $return;
+
+ }
+
+
+}
diff --git a/common/models/Test.php b/common/models/Test.php
new file mode 100644
index 0000000..d7e21d8
--- /dev/null
+++ b/common/models/Test.php
@@ -0,0 +1,85 @@
+select($select)
+ ->limit(100)
+ ->asArray(true)
+ ->all();
+ return $list;
+ }
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [['id'], 'number'],
+ [['name'], 'string', 'max' => 255],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'Order ID',
+ 'name' => 'Spider Order ID',
+ ];
+ }
+
+ /**
+ * Function Description:插入主订单
+ * Function Name: insertOrder
+ *
+ * @return bool
+ *
+ * @author 娄梦宁
+ */
+ public function insertOrder(){
+ $values=[
+ 'name'=>'3333',
+ ];
+ $transaction=Yii::$app->db->beginTransaction();
+ try{
+ $this->attributes=$values;
+ $res=$this->insert(true);
+ if(!$res){
+ throw new Exception('添加出错');
+ }
+ $transaction->commit();
+ return true;
+ }catch (Exception $e){
+ $transaction->rollBack();
+ return false;
+ }
+ }
+}
+
diff --git a/common/util/AliPay.php b/common/util/AliPay.php
new file mode 100644
index 0000000..00f3b86
--- /dev/null
+++ b/common/util/AliPay.php
@@ -0,0 +1,318 @@
+getAliPayUrl($params);
+ $url = $siteConfig['host_name'] . '/fx/?r=weChat/we-chat/q-code&qCode=' . urlencode($getUrl['data']['codUrl']) . '&_math=' . rand(100, 999);
+ return Util::returnArrSu('', array('codUrl' => $url, 'price' => $par['total_fee']));
+ }
+
+ /**
+ * Function Description:支付宝web支付
+ * Function Name: webPay
+ * @param $param array
+ * @return array
+ *
+ * @author nzf
+ */
+ public function webPay($param)
+ {
+ //交易参数
+ $params['body'] = $param['name'];
+ $params['subject'] = $param['name'];
+ $params['order_id'] = $param['order_id'];
+ $params['price'] = $param['total_fee'];
+ $params['timeout_express'] = '1m';
+ $params['goType'] = 2;
+ $params['method'] = 'alipay.trade.wap.pay';
+ $return = static::getAliPayUrl($params);
+ return $return;
+ }
+
+ /********************通用方法**************************/
+ /**
+ * Function Description:获取阿里支付pay
+ * Function Name: getAliPayUrl
+ * @param $params array
+ *
+ * @return array
+ *
+ * @author 倪宗�?
+ */
+ private static function getAliPayUrl($params)
+ {
+ $config = self::getAliPayConfig();
+ $sysParams = self::getSysParams();
+ $sysParams["method"] = $params['method'];
+ //交易参数
+ $body['productCode'] = 'QUICK_WAP_PAY';
+ $body['body'] = $params['body'];
+ $body['subject'] = $params['subject'];
+ $body['out_trade_no'] = $params['order_id'];
+ $body['total_amount'] = $params['price'];
+ $body['timeout_express'] = $config['timeout'];
+
+ $sysParams['biz_content'] = json_encode($body);
+ if ($params['goType'] == 1) {//如果是页面跳�?
+ $sysParams['sign'] = urlencode(static::getSign($sysParams));
+ $paramString = static::getSignContent($sysParams);
+ $requestUrl = $config['gatewayUrl'] . "?" . $paramString;
+ return Util::returnArrSu('', ['payData' => $requestUrl]);
+ } elseif ($params['goType'] == 2) {//如果是参数返�?
+ $sysParams['sign'] = static::getSign($sysParams);
+ $result = self::buildRequestForm($sysParams);
+ return Util::returnArrSu('', ['payData' => $result]);
+ } else {
+ $sysParams['sign'] = urlencode(static::getSign($sysParams));
+ $paramString = static::getSignContent($sysParams);
+ $requestUrl = $config['gatewayUrl'] . "?" . $paramString;
+ $curl = new CurlInterface('', 5);
+ $result = $curl->execute($requestUrl, 'GET');
+ $result = json_decode($result, true);
+ $return['codUrl'] = '';
+ if ($result['alipay_trade_precreate_response']['code'] == '10000') {
+ $return['codUrl'] = $result['alipay_trade_precreate_response']['qr_code'];
+ }
+ return Util::returnArrSu('', $return);
+ }
+ }
+
+ /**
+ * Function Description:取消订单
+ * Function Name: cancelOrder
+ * @param $params
+ *
+ * @return array
+ *
+ * @author 倪宗�?
+ */
+ public static function cancelOrder($params)
+ {
+ $config = self::getAliPayConfig();
+ $sysParams = self::getSysParams();
+ $sysParams["method"] = 'alipay.trade.refund';
+ $body = array(
+ 'out_trade_no' => $params['order_id'],//订单�?
+ 'refund_amount' => $params['refund_fee'],//退款金额
+ 'refund_reason' => $params['memo'],
+ 'out_request_no' => $params['order_id'] . '-' . date('YmdHis') . rand(100, 999)//�?款原�?
+ );
+ $sysParams['biz_content'] = json_encode($body);
+ $sysParams['sign'] = static::getSign($sysParams);
+ $sysParams['sign'] = urlencode(static::getSign($sysParams));
+ $paramString = static::getSignContent($sysParams);
+ $requestUrl = $config['gatewayUrl'] . "?" . $paramString;
+ //调用�?款接�?
+ $curlInterface = new CurlInterface($sysParams, 5);
+ $result = $curlInterface->execute($requestUrl, 'GET');
+ $result = json_decode(mb_convert_encoding($result, 'utf-8'), true);
+ if (isset($result['alipay_trade_refund_response']) && $result['alipay_trade_refund_response']['code'] == '10000') {
+ return Util::returnArrSu();
+ }
+ return Util::returnArrEr('退款失败!');
+ }
+
+ /**
+ * Function Description:获取系统通用参数
+ * Function Name: getSysParams
+ *
+ * @return mixed
+ *
+ * @author 倪宗�?
+ */
+ private static function getSysParams()
+ {
+ $config = self::getAliPayConfig();
+ $siteConfig = Util::getSiteConfig();
+ //组装系统参数
+ $sysParams["app_id"] = $config['app_id'];
+ $sysParams["version"] = '1.0';
+ $sysParams["format"] = 'json';
+ $sysParams["sign_type"] = 'RSA';
+
+ $sysParams["timestamp"] = date("Y-m-d H:i:s");
+ $sysParams["alipay_sdk"] = 'alipay-sdk-php-20160411';
+ $sysParams["prod_code"] = '';
+ $sysParams["notify_url"] = $siteConfig['host_name'] . $siteConfig['notify_url'];
+// $sysParams["return_url"] = $config['return_url'];
+ $sysParams["charset"] = $config['charset'];
+ return $sysParams;
+ }
+
+ /**
+ * Function Description:建立请求,以表单HTML形式构�?�(默认�?
+ * Function Name: buildRequestForm
+ * @param $para_temp
+ *
+ * @return string 提交表单HTML文本
+ *
+ * @author 倪宗�?
+ */
+ protected static function buildRequestForm($para_temp)
+ {
+ $config = self::getAliPayConfig();
+ $sHtml = "