Selaa lähdekoodia

Merge branch 'iOIL' of 39.97.239.116:gyfl/xyzshop into iOIL

stanley-king 4 vuotta sitten
vanhempi
commit
a375893173

+ 86 - 0
conf/nginx/nginx-win-http.conf

@@ -0,0 +1,86 @@
+
+user nginx;
+worker_processes  1;
+error_log   /var/error.log  info;
+#pid        logs/nginx.pid;
+worker_rlimit_nofile 1024;
+
+events {
+    worker_connections  1024;
+}
+
+http 
+{
+    include       mime.types;
+    default_type  application/octet-stream;
+    fastcgi_buffer_size 32k;
+    fastcgi_buffers 8 32k;
+    underscores_in_headers on;
+    client_max_body_size 1024M;
+
+    sendfile            on;
+    keepalive_timeout   65;
+
+    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+                      '$status $body_bytes_sent "$http_referer" '
+                      '"$http_user_agent" "$http_x_forwarded_for"';
+
+    server 
+    {
+    	listen       80;
+        set  $folder_name /var/www/html;
+        server_name 192.168.1.195;
+        root $folder_name;
+        index index.html index.php; 
+    	client_max_body_size 100m;
+    	proxy_connect_timeout 500s;
+        proxy_read_timeout 500s;
+        proxy_send_timeout 500s;
+        fastcgi_connect_timeout 75;
+        fastcgi_read_timeout 600;   
+        fastcgi_send_timeout 600;   
+
+        charset utf-8;
+        
+        location /logs {
+            deny all;
+            return 403;
+        }
+
+        location /data/log {
+            deny all;
+            return 403;
+        }
+        location / {
+            index  index.html index.htm index.php;
+        }
+        
+        location /mshop {
+            root $folder_name;
+            autoindex on;        
+            index  index.html index.htm index.php;
+	        try_files $uri $uri/ /mshop/index.html;
+        }
+
+        location ~ /mobile/[/\w]+\.php$ {
+            root           $folder_name;
+            fastcgi_pass   mobilesrv:9100;
+            fastcgi_index  index.php;
+            fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
+            include fastcgi_params;
+        }
+
+        location ~ /mobile/[/\w]+\.html$ {
+            try_files $uri $uri/ /mobile/index.html;
+        }
+
+        location ~ \.php$ {
+	        add_header Cache-Control no-store;
+            root           $folder_name;
+            fastcgi_pass   websrv:9000;
+            fastcgi_index  index.php;
+            fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
+            include        fastcgi_params;
+        }
+    }
+}

+ 106 - 0
data/config/win/base.ini.php

@@ -0,0 +1,106 @@
+<?php declare(strict_types=1);
+defined('InShopNC') or exit('Access Invalid!');
+
+define('USE_REMOTE_IMAGE',false);
+define('DEBUG_MODE',true);
+define('MOBILE_PUBLISH',false);
+define('PUSH_OMS',true);
+define('LOCAL_DEBUG',false);
+define('BONUS_EXPIRY_DATE',true);
+define('USE_BONUS_RATE',false);
+define('SERVER_TYPE','panda');
+
+define('COOKIE_DOMAIN','192.168.1.195');
+define('NET_IP','111.193.234.45');
+
+$SRV_HOST = 'http://192.168.1.195';
+$REMOTE_IMG_HOST = $SRV_HOST;
+
+$config = [];
+$config['base_site_url']        = $SRV_HOST;
+$config['client_site_url']      = $SRV_HOST;
+$config['shop_site_url'] 		= $SRV_HOST.'/shop';
+$config['cms_site_url'] 		= $SRV_HOST.'/cms';
+$config['microshop_site_url'] 	= $SRV_HOST.'/microshop';
+$config['circle_site_url'] 		= $SRV_HOST.'/circle';
+$config['admin_site_url'] 		= $SRV_HOST.'/admin';
+$config['mobile_site_url'] 		= $SRV_HOST.'/mobile';
+$config['wap_site_url'] 		= $SRV_HOST.'/wap';
+$config['chat_site_url'] 		= $SRV_HOST.'/chat';
+$config['node_site_url'] 		= 'http://127.0.0.1:8090';
+$config['delivery_site_url']    = $SRV_HOST.'/delivery';
+
+if(defined('USE_REMOTE_IMAGE') && USE_REMOTE_IMAGE == true) {
+    $config['upload_site_url']		= $REMOTE_IMG_HOST.'/data/upload';
+    $config['resource_site_url']	= $REMOTE_IMG_HOST.'/data/resource';
+} else {
+    $config['upload_site_url']		= $SRV_HOST.'/data/upload';
+    $config['resource_site_url']	= $SRV_HOST.'/data/resource';
+}
+
+$config['version'] 	= '201502020388';
+$config['setup_date'] = '2015-08-22 15:52:34';
+$config['gip'] 		= 0;
+$config['dbdriver'] = 'mysqli';
+$config['tablepre']	= 'lrlz_';
+
+$config['db'][1]['dbhost']       = 'host.docker.internal';
+$config['db'][1]['dbport']       = '3306';
+$config['db'][1]['dbuser']       = 'root';
+$config['db'][1]['dbpwd']        = 'root';
+$config['db'][1]['dbname']       = 'xyzshop';
+$config['db'][1]['dbcharset']    = 'UTF-8';
+
+$config['db']['slave'][0]['dbhost']     = 'host.docker.internal';
+$config['db']['slave'][0]['dbport']     = '3306';
+$config['db']['slave'][0]['dbuser']     = 'root';
+$config['db']['slave'][0]['dbpwd']      = 'root';
+$config['db']['slave'][0]['dbname']     = 'xyzshop';
+$config['db']['slave'][0]['dbcharset']  = 'UTF-8';
+
+$config['session_expire'] 	= 3600;
+$config['lang_type'] 		= 'zh_cn';
+$config['cookie_pre'] 		= '6B0C_';
+$config['thumb']['cut_type'] = 'gd';
+$config['thumb']['impath'] = '';
+
+$config['cache']['type'] 		= 'redis';
+$config['redis']['prefix']      	= 'nc_';
+$config['redis']['master']['host']     	= 'tcp://redisrv';
+$config['redis']['master']['port']     	= 6379;
+$config['redis']['master']['pconnect'] 	= 0;
+$config['redis']['slave']['host']     	= 'tcp://redisrv';
+$config['redis']['slave']['port']     	= 6379;
+$config['redis']['slave']['pconnect'] 	= 0;
+
+
+//$config['fullindexer']['open']      = false;
+//$config['fullindexer']['appname']   = '33hao';
+$config['debug'] 		      = false;
+$config['default_store_id'] = '1';
+//如果开始伪静态,这里设置为true
+$config['url_model'] = false;
+
+//如果店铺开启二级域名绑定的,这里填写主域名如baidu.com
+$config['subdomain_suffix'] = '';
+$config['session_type'] = 'redis';
+$config['session_save_path'] = 'tcp://redisrv:6379';
+$config['node_chat'] = true;
+
+//流量记录表数量,为1~10之间的数字,默认为3,数字设置完成后请不要轻易修改,否则可能造成流量统计功能数据错误
+$config['flowstat_tablenum'] = 3;
+$config['sms']['gwUrl'] = 'http://sdkhttp.eucp.b2m.cn/sdk/SDKService';
+$config['sms']['serialNumber'] = '';
+$config['sms']['password']     = '';
+$config['sms']['sessionKey']   = '';
+
+$config['queue']['open'] = true;
+$config['queue']['host'] = 'tcp://redisrv';
+$config['queue']['port'] = 6379;
+$config['cache_open']    = true;
+
+$config['return_address'] = ['address' => '上海市金山区朱吕公路7335号','name' => "大熊猫(丽帆供应链)",'tel_phone' => '17301603655','zip_code' => '201600'];
+$config['area_version'] = 5;
+$config['appjump_prefix'] = 'xyzshop://www.xyzshops.com';
+
+$config['client_setting'] = ['running' => 174,'home' => 0];

+ 81 - 0
data/config/win/pay.ini.php

@@ -0,0 +1,81 @@
+<?php declare(strict_types=1);
+defined('InShopNC') or exit('Access Invalid!');
+
+define('ALIPAY_PATH', BASE_DATA_PATH . '/api/alipay');
+define('ALIPAY_PARTNER', '2088121219613123');
+define('ALIPAY_SELLER_ID', 'napheir.ao@lrlz.com');
+
+define('MINIPAY_WXPAY_APPID',       'wx4139a76ccb1f74b3');
+define('MINIPAY_WXPAY_APPSECRET',   '708ce8faa4ec48ba689b03e8fa7e592c');
+
+define('MINIPAY_WXPAY_MCHID',       '1600686690');
+define('MINIPAY_WXPAY_KEY',         '0f86a4a9b1edb51b1a8d180fa228a157');
+define('MINIPAY_WXPAY_SSLCERT_PATH', '../cert/xyz_cert.pem');
+define('MINIPAY_WXPAY_SSLKEY_PATH',  '../cert/xyz_key.pem');
+
+define('OPENWX_APPID',       'wx24c5645aa986234a');
+
+define('WX_MCHID',       '1279745801');
+define('WX_MCHKEY',         '0f86a4a9b1edb51b1a7d110fa223a157');
+define('OPENWX_APPSECRET',   '41f93fef3207e917e742b9ebcd540cb2');
+define('WX_SSLCERT_PATH', '../cert/panda_cert.pem');
+define('WX_SSLKEY_PATH',  '../cert/panda_key.pem');
+
+
+//H5端,用户身份信息授权用的,数据来自 公众号->设置->基本配置
+//SIGN_APPID 和 AUTHOR_APPID是相同的.
+define('PUB_APPID',       'wx38f1d15c5337e89b');
+define('PUB_APPSECRET',   'fd6436e7427476dbe71a6333b3b02a96');
+
+define('PUB_APPID',       'wx38f1d15c5337e89b');
+define('PUB_APPSECRET',   'fd6436e7427476dbe71a6333b3b02a96');
+
+//for panda
+//define(ALIPAY_PATH, BASE_DATA_PATH . '/api/alipay');
+//define(ALIPAY_PARTNER, '2088121219613123');
+//define(ALIPAY_SELLER_ID, 'napheir.ao@lrlz.com');
+//
+//define(MINIPAY_WXPAY_APPID,       'wxfdaeb25e38c4c47e');
+//define(MINIPAY_WXPAY_APPSECRET,   'e5b5055cbc608d10c6de0d877c221270');
+//define(MINIPAY_WXPAY_MCHID,       '1380733702');
+//define(MINIPAY_WXPAY_KEY,         '0f86a4a9b1edb51b1a7d110fa223a157');
+//define(MINIPAY_WXPAY_SSLCERT_PATH, '../cert/panda_cert.pem');
+//define(MINIPAY_WXPAY_SSLKEY_PATH,  '../cert/panda_key.pem');
+//
+//define(OPENWX_APPID,       'wx24c5645aa986234a');
+//define(WX_MCHID,       '1279745801');
+//define(WX_MCHKEY,         '0f86a4a9b1edb51b1a7d110fa223a157');
+//define(OPENWX_APPSECRET,   '41f93fef3207e917e742b9ebcd540cb2');
+//define(WX_SSLCERT_PATH, '../cert/panda_cert.pem');
+//define(WX_SSLKEY_PATH,  '../cert/panda_key.pem');
+//
+//define(PUB_APPID,       'wx6b42e00ecaade538');
+//define(PUB_APPSECRET,   'ee64233b3144d76217161666f8cb4c86');
+//define(PUB_APPID,       'wx6b42e00ecaade538');
+//define(PUB_APPSECRET,   'ee64233b3144d76217161666f8cb4c86');
+
+
+//for car
+//define(ALIPAY_PATH, BASE_DATA_PATH . '/api/caralipay');
+//define(ALIPAY_PARTNER, '2088921850833159');
+//define(ALIPAY_SELLER_ID, 'jyc2018168@163.com');
+//
+//define(MINIPAY_WXPAY_APPID,       'wx4054b8152626bae7');
+//define(MINIPAY_WXPAY_APPSECRET,   '77f63e0b8e961b29e9f947ba5f02d0e8');
+//define(MINIPAY_WXPAY_MCHID,       '1500211542');  //'1498498152'
+//define(MINIPAY_WXPAY_KEY,         '2b135842e47ae1935365d43a952cd5b6');
+//define(MINIPAY_WXPAY_SSLCERT_PATH, '../cert/car_cert.pem');
+//define(MINIPAY_WXPAY_SSLKEY_PATH,  '../cert/car_key.pem');
+//
+//define(OPENWX_APPID,       'wx73acdf06232c6a33');
+//define(OPENWX_APPSECRET,   '92f261a220c79cf3711356ba91d1cb30');
+
+//define(WX_MCHID,       '1498498152');
+//define(WX_MCHKEY,         '2b135842e47ae1935365d43a952cd5b6');
+//define(WX_SSLCERT_PATH, '../cert/car_cert.pem');
+//define(WX_SSLKEY_PATH,  '../cert/car_key.pem');
+//
+//define(PUB_APPID,       'wxaf698e1cc5f2073b');
+//define(PUB_APPSECRET,   'da0547505e7bd29a50cdf662cc7b559a');
+//define(PUB_APPID,       'wxaf698e1cc5f2073b');
+//define(PUB_APPSECRET,   'da0547505e7bd29a50cdf662cc7b559a');

+ 21 - 0
data/config/win/refill.ini.php

@@ -0,0 +1,21 @@
+<?php
+
+
+$suhc_oil = ['name' => 'suhc','store_id' => 8,'card_type' => ['sinopec'],
+    'amount' => [100 => ['goods_id' => 6226,'price' => 96.8],
+        200 => ['goods_id' => 6227,'price' => 197.6],
+        500 => ['goods_id' => 6228,'price' => 484],
+        1000=> ['goods_id' => 6229,'price' => 968],
+        2000=> ['goods_id' => 6230,'price' => 1976]],
+    'period' => ['start' => '8:30','end' => '22:30'],'refill_type' => 'api'];
+$oil_providers = ['suhc' => $suhc_oil];
+$config['oil_providers'] = $oil_providers;
+
+
+$beixt_phone = ['name' => 'beixt','store_id' => 9,'card_type' => ['chinamobile','chinaunicom','chinatelecom'],
+    'amount' => [50 => ['goods_id' => 6231,'price' => 48.75],
+        100 => ['goods_id' => 6232,'price' => 97.5],
+        200 => ['goods_id' => 6233,'price' => 195]],
+    'refill_type' => 'api'];
+$phone_providers = ['beixt' => $beixt_phone];
+$config['phone_providers'] = $phone_providers;

+ 26 - 0
data/config/win/special.ini.php

@@ -0,0 +1,26 @@
+<?php declare(strict_types=1);
+defined('InShopNC') or exit('Access Invalid!');
+
+$config['old_tabs'] = [
+    ['special_id' => 1,'name' => "测试下小雄"],
+    ['special_id' => 53,'name' => "启动页"]];
+$config['old_specials'] = [0,57];
+$config['bonus_match_goods'] = ['special_id' => 69];
+
+//fcodes_specialid 所有赠送的F码列表,banner_id
+$config['autosend_fcodes'] = ['fcodes_spid' => 283,'payconfirm_spid' => 67,'cart_spid' => 65, 'myfcode_sid' => 0,'order_present' => 70];
+$config['goods_sampler'] = ['male' => 295 ,'female' => 296];
+$config['hotlist_image'] = [1 => '1.png',2 => '2.png',3 => '3.png',4 => '4.png',5 => '5.png',6 => '6.png',7 => '7.png',8 => '8.png',9 => '9.png',10 => '10.png'];
+
+//红包价和内买价的差别,描述语
+$config['bonus_gap']   = ['have_gap' => "离员工价¥%s,还差¥%s",'no_gap' => "已达员工价¥%s,下单吧!",'earn_bonus' => 'xmmz://p.lrlz.com/block/special?title=找红包&special_id=304&isSpecial=true'];
+$config['bonus_gapex'] = ['have_gap' => "离红包价¥%s,还差¥%s",'no_gap' => "已达红包价¥%s,下单吧!",'earn_bonus' => 'xmmz://p.lrlz.com/block/special?title=找红包&special_id=304&isSpecial=true'];
+
+$config['exclude_brands'] = [43,44,138];
+$config['optional_goods'] = [];
+$config['bargain_goods']  = ['special_ids' => [303],'usable_days' => 5,'max_day_count' => 5];
+$config['ugc_banner'] = ['pub' => 269,'friend' => 0, 'mine' => 0];
+$config['bonus_detail_banner'] = ['usable' => [0,0],'expiring' => [0,0],'used' => [0,0],'expired' => [0,0],'send' => [0,0]];
+$config['special_header'] = ['guess_like' => 305];
+
+$config['special_pay_success'] = 1036;

+ 29 - 0
data/config/win/srv.ini.php

@@ -0,0 +1,29 @@
+<?php declare(strict_types=1);
+defined('InShopNC') or exit('Access Invalid!');
+
+define('LOCAL_DOMAIN','192.168.1.200');
+
+$config['searcher']['host'] = 'searcher';
+$config['searcher']['port'] = 2000;
+
+$config['relation']['host'] = LOCAL_DOMAIN;
+$config['relation']['port'] = 5000;
+
+$config['room_srv']['host'] = LOCAL_DOMAIN;
+$config['room_srv']['ports'] = [2010];
+
+$config['room_factory']['host'] = LOCAL_DOMAIN;
+$config['room_factory']['port'] = 2002;
+
+$config['room_factory']['rooms_addr'] = [
+    ['host' => LOCAL_DOMAIN,'port' => '2010']
+//    ['host' => '192.168.0.200','port' => '2011']
+//    ['host' => '192.168.0.200','port' => '2012'],
+//    ['host' => '192.168.0.200','port' => '2013'],
+//    ['host' => '192.168.0.200','port' => '2014'],
+];
+
+//$config['access_addr'] = 'wss://panda.lrlz.com:8080';
+$config['access_addr'] = 'ws://192.168.1.200:8080';
+$config['special_rooms'] = ['shake_bonus' => 37];
+$config['room_password'] = '5566889955668899';

+ 9 - 0
data/config/win/ugcman.config.ini

@@ -0,0 +1,9 @@
+{
+    "DB": {
+        "host": "127.0.0.1",
+        "port": 3306,
+        "name": "pandashop",
+        "user": "root",
+        "passwd": "55668899"
+    }
+}

+ 92 - 0
data/config/win/vgoods.ini.php

@@ -0,0 +1,92 @@
+<?php
+declare(strict_types=0);
+
+$config['exclude_preferential_goods_ids'] = [6217];
+$config['card_commonid'] = ['oil' => 3449, 'phone' => 3450];
+$config['vgoods_spec_card'] = [6218 => 100, 6219 => 200, 6220 => 100, 6221 => 200,6224 => 500, 6225 => 1000];
+
+
+//$config['tips'] =  ['first_order' => '首次充值享受会员价95折',
+//                    'vip_first_order' => '会员充值全场95折',
+//                    'none_vip' => '点击右上角分享给好友、升级会员都能享受95折',
+//                    'vip_user' => '点击右上角,分享给好友,一起省钱吧~'];
+
+$handlers = [];
+#type:虚拟商品类型,order_method下午单后的自动操作函数,
+#paid_oper 支付完成后的操作类型,auto 表示自动,manual 表示人工点击,paid_method表示点击调用的方法
+#input_params 表示输入必须带的参数。
+
+#'order_method' 成功下订单事件
+#paid_method 支付成功事件
+#cancel_method 取消订单
+#input_params 下订单是需要检查的参数,并带到extra_info.
+#additional 预先提供的参数
+
+#会员卡 vip_card
+$mcard_params =['type' => 'member_card', 
+                'paid_method' => 'OnMCardPaidSuccess',
+                'additional' => ['card_type' => 'year']];
+$handlers[6217] = $mcard_params;
+
+#oil card
+$oil_params = ['type' => 'oil_card', 'order_check'     => 'OnOilCardCheck',
+                                     'order_method'    => 'OnReserveOilCard',
+                                     'complete_method' => 'OnCardKeyComplete',
+                                     'cancel_method' => 'OnCardKeyCancel',
+                                     'input_params'  => ['card_no','card_type','phone_no']];
+$handlers[6218] = $oil_params;
+$handlers[6219] = $oil_params;
+$handlers[6224] = $oil_params;
+$handlers[6225] = $oil_params;
+
+#phone card
+$phone_card_prams = ['type' => 'phone_card', 'order_check'     => 'OnPhoneCardCheck',
+                                             'order_method'    => 'OnReservePhoneCard',
+                                             'complete_method' => 'OnCardKeyComplete',
+                                             'cancel_method' => 'OnCardKeyCancel',
+                                             'input_params'  => ['card_no','card_type']];
+$handlers[6220] = $phone_card_prams;
+$handlers[6221] = $phone_card_prams;
+
+$config['vgoods_handlers'] = $handlers;
+
+//6220 话费 amount = 100
+$share_policy[6220] = [
+    ['num' => 1,  'discount' => 0.05,'price' => 0.95]
+];
+
+//6220 话费 amount = 200
+$share_policy[6221] = [
+    ['num' => 3,  'discount' => 0.10,  'price' => 1.90],
+    ['num' => 2,  'discount' => 0.08,  'price' => 1.92],
+    ['num' => 1,  'discount' => 0.05,  'price' => 1.95]
+];
+
+//6220 油费 amount = 100
+$share_policy[6218] = [
+    ['num' => 1,  'discount' => 0.05, 'price' => 0.95]
+];
+
+//6220 油费 amount = 200
+$share_policy[6219] = [
+    ['num' => 3,  'discount' => 0.10,  'price' => 1.90],
+    ['num' => 2,  'discount' => 0.08,  'price' => 1.92],
+    ['num' => 1,  'discount' => 0.05,  'price' => 1.95]
+];
+
+//6220 油费 amount = 500
+$share_policy[6224] = [
+    ['num' => 3,  'discount' => 0.25,  'price' => 4.75],
+    ['num' => 2,  'discount' => 0.20,  'price' => 4.80],
+    ['num' => 1,  'discount' => 0.15,  'price' => 4.85]
+];
+
+//6220 油费 amount = 1000
+$share_policy[6225] = [
+    ['num' => 5,  'discount' => 0.50,  'price' => 9.50],
+    ['num' => 3,  'discount' => 0.40,  'price' => 9.60],
+    ['num' => 2,  'discount' => 0.30,  'price' => 9.70],
+    ['num' => 1,  'discount' => 0.25,  'price' => 9.75]
+];
+
+$config['goods_share_policy'] = $share_policy;

+ 14 - 0
data/config/win/webacc.config.ini

@@ -0,0 +1,14 @@
+{
+    "room_addrs":[
+            { "host":"192.168.0.200","port":2010}
+            ],
+    "factory_addr": { "host":"192.168.0.200","port":2002},
+    "acc_addr":{"host":"0.0.0.0", "port":8080},
+    "DB": {
+        "host": "127.0.0.1",
+        "port": 3306,
+        "name": "pandashop",
+        "user": "root",
+        "passwd": "55668899"
+    }
+}

+ 27 - 0
data/model/merchant.model.php

@@ -12,4 +12,31 @@ class merchantModel extends Model
     {
         return $this->table('merchant_price')->where(['mchid' => $mchid,'spec' => $amount])->select();
     }
+
+    public function getMerchantInfo($condition) {
+        $result = $this->table('merchant')->where($condition)->find();
+        return $result;
+    }
+
+    public function editMerchant($update, $condition){
+        return $this->table('merchant')->where($condition)->update($update);
+    }
+
+    public function getPdlog($condition, $pagesize = '', $field = '*', $order = '', $limit = '')
+    {
+        $pdlog = $this->table('pd_log')->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
+        foreach ($pdlog as $key=>$value){
+            if (isset($value['lg_add_time'])) {
+                $pdlog[$key]['lg_add_time'] = date('Y-m-d H:i:s', $value['lg_add_time']);
+            }
+            if($value['lg_type'] == 1){
+                $pdlog[$key]['lg_type'] = '减款';
+            }elseif($value['lg_type'] == 2){
+                $pdlog[$key]['lg_type'] = '加款';
+            }else{
+                $pdlog[$key]['lg_type'] = 'unknown';
+            }
+        }
+        return $pdlog;
+    }
 }

+ 5 - 6
data/model/refill_order.model.php

@@ -27,10 +27,9 @@ class refill_orderModel extends Model
     {
         return$this->table('refill_order')->where(['order_id' => $order_id])->update($data);
     }
-    public function getMerchantOrderList($condition, $page = 1, $field = '*', $order = 'refill_order.order_id desc', $limit = 10)
+    public function getMerchantOrderList($condition, $pagesize = '', $field = '*', $order = 'refill_order.order_id desc', $limit = '')
     {
-        $offset = ($page - 1) * $limit;
-        $list = $this->table('refill_order,vr_order')->field($field)->where($condition)->join('left')->on('refill_order.order_id=vr_order.order_id')->order($order)->page($offset,$limit)->select();
+        $list = $this->table('refill_order,vr_order')->field($field)->where($condition)->join('left')->on('refill_order.order_id=vr_order.order_id')->page($pagesize)->order($order)->limit($limit)->select();
         if (empty($list)) return array();
         return $this->merchant_order_format($list);
     }
@@ -41,10 +40,10 @@ class refill_orderModel extends Model
             if (isset($order['order_time'])) {
                 $orders[$key]['order_time'] = date('Y-m-d H:i:s', $order['order_time']);
             }
-            if (isset($order['notify_time'])) {
-                $orders[$key]['notify_time'] = date('Y-m-d H:i:s', $order['notify_time']);
+            if (isset($order['mch_notify_times'])) {
+                $orders[$key]['mch_notify_times'] = date('Y-m-d H:i:s', $order['mch_notify_times']);
             }
-            $orders[$key]['notify_state'] = $notify_state[$order['notify_state']-2];
+            $orders[$key]['mch_notify_state'] = $notify_state[$order['mch_notify_state']-2];
             $orders[$key]['card_type_name'] = $this->scard_type($order['card_type']);
         }
         return $orders;

+ 1 - 1
docker-compose-win.yml

@@ -10,7 +10,7 @@ services:
       - /d/phpstudy_pro/WWW/xyzshop/conf/etc/localtime:/etc/localtime:ro
       - /d/phpstudy_pro/WWW/xyzshop/upload:/var/www/html/data/upload
       - /d/phpstudy_pro/WWW/xyzshop/conf/nginx/cert:/etc/nginx/cert
-      - /d/phpstudy_pro/WWW/xyzshop/conf/nginx/nginx-debug-http.conf:/etc/nginx/nginx.conf:ro
+      - /d/phpstudy_pro/WWW/xyzshop/conf/nginx/nginx-win-http.conf:/etc/nginx/nginx.conf:ro
     links:
       - mobilesrv
       - websrv

+ 17 - 2
mobile/control/merchant_base.php

@@ -5,7 +5,8 @@ require_once (BASE_HELPER_PATH . "/session_helper.php");
 class merchant_baseControl
 {
     //列表默认分页数
-    protected $page = 1;
+    protected $page;
+    protected $cur_page;
 
     public function __construct()
     {
@@ -17,10 +18,18 @@ class merchant_baseControl
                 throw new UnloginException();
             }
         }
-        //分页数处理
         if (is_numeric($_GET['page']) && intval(trim($_GET['page'])) > 0) {
             $this->page = intval(trim($_GET['page']));
+        } else {
+            $this->page = 10;
+        }
+
+        if (is_numeric($_GET['curpage']) && intval(trim($_GET['curpage'])) > 0) {
+            $this->cur_page = intval(trim($_GET['curpage']));
+        } else {
+            $this->cur_page = 1;
         }
+        $this->initpage($this->page, $this->cur_page);
     }
 
 
@@ -137,4 +146,10 @@ class merchant_baseControl
 
         return true;
     }
+
+    protected function initpage($page_size,$cur_page)
+    {
+        pagecmd('seteachnum', $page_size);
+        pagecmd('setnowpage', $cur_page);
+    }
 }

+ 116 - 2
mobile/control/merchant_info.php

@@ -1,7 +1,121 @@
 <?php
+require_once(BASE_ROOT_PATH . '/mobile/control/merchant_base.php');
 
-
-class merchant_info
+class merchant_infoControl extends merchant_baseControl
 {
+    public function __construct()
+    {
+        parent::__construct();
+
+    }
+    public function indexOp(){
+        $model_merchant = Model('merchant');
+        $merchant_info = $model_merchant->getMerchantInfo(array('mchid' => $_SESSION['merchant_login_id']));
+        $model_member = Model('member');
+        $member_info = $model_member->getMemberInfo(
+            array(
+                'member_id' => $merchant_info['admin_id']
+            ),
+            'available_predeposit'
+        );
+        $merchant_info['member'] = $member_info;
+        return self::outsuccess($merchant_info);
+    }
+    public function ipwhitelistOp(){
+        $model_merchant = Model('merchant');
+        $merchant_info = $model_merchant->getMerchantInfo(array('mchid' => $_SESSION['merchant_login_id']));
+        $ipwhitelist = unserialize($merchant_info['ip_white_list']);
+        return self::outsuccess($this->arrayTransitionObject($ipwhitelist));
+    }
+    public function addipOp(){
+        if (!isset($_POST['ip'])){
+            return self::outerr(errcode::ErrParamter , "参数错误" );
+        }
+        if(filter_var($_POST['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
+            $model_merchant = Model('merchant');
+            $merchant_info = $model_merchant->getMerchantInfo(array('mchid' => $_SESSION['merchant_login_id']));
+            $ipwhitelist = unserialize($merchant_info['ip_white_list']);
+            $ipwhitelist[] = $_POST['ip'];
+            $ret = $model_merchant->editMerchant(array('ip_white_list'=>serialize($ipwhitelist)), array('mchid' => $merchant_info['mchid']));
+            if($ret){
+                return self::outsuccess([]);
+            }else{
+                return self::outerr(errcode::ErrOperation, "系统错误.");
+            }
+        }
+        else {
+            return self::outerr(errcode::ErrParamter , "ip地址错误" );
+        }
+    }
+    public function ipdelOp(){
+        if (!isset($_POST['ip_key'])){
+            return self::outerr(errcode::ErrParamter , "参数错误" );
+        }
+        $model_merchant = Model('merchant');
+        $merchant_info = $model_merchant->getMerchantInfo(array('mchid' => $_SESSION['merchant_login_id']));
+        $ipwhitelist = unserialize($merchant_info['ip_white_list']);
+        unset($ipwhitelist[$_POST['ip_key']]);
+        foreach ($ipwhitelist as $key =>$value){
+            $new_ip_list[] = $value;
+        }
+        $ipwhitelist = serialize($new_ip_list);
+        $ret = $model_merchant->editMerchant(array('ip_white_list'=>$ipwhitelist), array('mchid' => $merchant_info['mchid']));
+        if($ret){
+            return self::outsuccess([]);
+        }else{
+            return self::outerr(errcode::ErrOperation, "系统错误.");
+        }
+    }
+    public function modifypwOp()
+    {
+        if (trim($_POST['new_pw']) !== trim($_POST['new_pw2'])){
+            return self::outerr(errcode::ErrPasswd , "密码错误" );
+        }
+        $model_merchant = Model('merchant');
+        $merchant_info = $model_merchant->getMerchantInfo(array('mchid' => $_SESSION['merchant_login_id']));
+        if(!$merchant_info){
+            return self::outerr(errcode::ErrMemberNotExist, "用户不存在.");
+        }
+        $pwd = trim($_POST['new_pw']);
+        if(md5($pwd) == $merchant_info['password']){
+            return self::outsuccess([]);
+        }
+        $ret = $model_merchant->editMerchant(array('password'=>md5($pwd)), array('mchid' => $merchant_info['mchid']));
+        if($ret){
+            return self::outsuccess([]);
+        }else{
+            return self::outerr(errcode::ErrOperation, "系统错误.");
+        }
+    }
+    public function pdlogOp(){
+        $model_pd = Model('merchant');
+        $condition = array();
+        $condition['lg_member_id'] = $_SESSION['member_id'];
+        if ($_GET['lg_type'] != '' && $_GET['lg_type'] != 0)
+        {
+            $condition['lg_type'] = $_GET['lg_type'];
+        }
+        if ($_GET['lg_order_sn'] != '')
+        {
+            $condition['lg_order_sn'] = $_GET['lg_order_sn'];
+        }
+        if($_GET['start_time'] && $_GET['end_time']){
+            $condition['lg_add_time'] = ['between', [$_GET['start_time'], $_GET['end_time']]];
+        }
+        $list = $model_pd->getPdlog($condition,$this->page,'*','lg_id desc',10);
+        $result['data'] = $list;
+        $result['total'] = $model_pd->gettotalpage();
+        return self::outsuccess($result);
+    }
 
+    protected function arrayTransitionObject(Array $array)
+    {
+        $data = [];
+        foreach ($array as $key => $val) {
+            $obj = new class{};
+            $obj->ip = $val;
+            $data[] = $obj;
+        }
+        return $data;
+    }
 }

+ 60 - 1
mobile/control/merchant_login.php

@@ -1,7 +1,66 @@
 <?php
 
+require_once(BASE_ROOT_PATH . '/mobile/control/merchant_base.php');
 
-class merchant_login
+//商户后台登录
+class merchant_loginControl extends merchant_baseControl
 {
+    public function __construct()
+    {
+        parent::__construct();
+//        if (!empty($_SESSION['merchant_login_id'])) {
+//            @header('location: index.php?act=seller_center');die;
+//        }
+    }
 
+    public function loginOp()
+    {
+        $model_merchant = Model('merchant');
+        $merchant_info = $model_merchant->getMerchantInfo(array('name' => $_POST['name']));
+        if($merchant_info){
+            if($merchant_info['password'] != md5(strtolower($_POST['password']))){
+                return self::outerr(errcode::ErrPasswd , "密码错误" );
+            }
+            if(!$merchant_info['ip_white_list']){
+                return self::outerr(errcode::ErrSafeIp, "无权限的IP.");
+            }
+            $clinet_ip = $_SERVER['REMOTE_ADDR'];
+            Log::record("ip : {$clinet_ip}" ,'DEBUG');
+            $is_safe_ip = $this->is_safe_ip($clinet_ip,$merchant_info['ip_white_list']);
+            if(!$is_safe_ip){
+                return self::outerr(errcode::ErrSafeIp, "无权限的IP");
+            }
+            $model_merchant->editMerchant(array('last_login_time' => TIMESTAMP,'last_login_ip' => $clinet_ip), array('mchid' => $merchant_info['mchid']));
+            $model_member = Model('member');
+            $member_info = $model_member->getMemberInfo(
+                array(
+                    'member_id' => $merchant_info['admin_id']
+                )
+            );
+
+            $_SESSION['merchant_login_id'] = $merchant_info['mchid'];
+            $_SESSION['member_id'] = $member_info['member_id'];
+            $_SESSION['member_name'] = $member_info['member_name'];
+            $_SESSION['member_email'] = $member_info['member_email'];
+            return self::outsuccess($merchant_info);
+        }else{
+            return self::outerr(errcode::ErrMemberNotExist, "用户不存在.");
+        }
+    }
+
+    public function logoutOp() {
+        setNcCookie('MPHPSESSID',0,-3600);
+        return self::outsuccess([]);
+    }
+
+    private function is_safe_ip($ip = "", $ips = "")
+    {
+        if (!$ip) $ip = $_SERVER["REMOTE_ADDR"];
+        $ips = unserialize($ips);
+        if (in_array($ip, $ips)) {
+            return true;
+        }else{
+            return false;
+        }
+    }
 }

+ 21 - 2
mobile/control/merchant_order.php

@@ -1,7 +1,26 @@
 <?php
+require_once(BASE_ROOT_PATH . '/mobile/control/merchant_base.php');
 
-
-class merchant_order
+class merchant_orderControl extends merchant_baseControl
 {
+    public function __construct()
+    {
+        parent::__construct();
+    }
 
+    public function listOp(){
+        $model_vr_order = Model('refill_order');
+        $condition = [];
+        if ($_GET['card_type'] != '' && $_GET['card_type'] != 0)
+        {
+            $condition['refill_order.card_type'] = $_GET['card_type'];
+        }
+        if($_GET['start_time'] && $_GET['ent_time']){
+            $condition['refill_order.order_time'] = ['between', [$_GET['start_time'], $_GET['end_time']]];
+        }
+        $order_list = $model_vr_order->getMerchantOrderList($condition, $this->page, '*', 'refill_order.order_id desc');
+        $result['data'] = $order_list;
+        $result['total'] = $model_vr_order->gettotalpage();
+        return self::outsuccess($result);
+    }
 }

+ 6 - 0
mobile/util/errcode.php

@@ -113,6 +113,8 @@ class errcode //extends SplEnum
     const ErrAccess = 19000;
     const ErrTalk = 20000;
 
+    const ErrSafeIp = 21000;
+    const ErrOperation = 22000;
 
     static function msg($code)
     {
@@ -217,6 +219,10 @@ class errcode //extends SplEnum
                 return '房间服务器不支持此access操作.';
             case errcode::ErrSignParamter:
                 return '请求参数需要做签名.';
+            case errcode::ErrSafeIp:
+                return '无权限的IP.';
+            case errcode::ErrOperation:
+                return '操作失败.';
             default :
                 return '系统错误.';
         }