stanley-king пре 4 година
родитељ
комит
a02d371427
44 измењених фајлова са 375 додато и 366 уклоњено
  1. 1 1
      data/config/dev/base.ini.php
  2. 4 2
      data/config/lingzh/base.ini.php
  3. 12 62
      docker/compose/lz-acc/docker-compose.yml
  4. 0 129
      docker/compose/lz-worker/docker-compose.yml
  5. 0 1
      docker/compose/stanley/docker-compose.yml
  6. 45 0
      docker/compose/worker/docker-compose.yml
  7. 91 0
      docker/compose/xyz-acc/docker-compose.yml
  8. 7 0
      docker/conf/nginx/nginx-acc-http.conf
  9. 112 0
      docker/conf/nginx/nginx-xyz-https.conf
  10. 0 1
      helper/fcgisrv/BaseServer.php
  11. 9 8
      helper/fcgisrv/LZRAccServer.php
  12. 8 9
      helper/fcgisrv/MobileServer.php
  13. 4 11
      helper/fcgisrv/RAccServer.php
  14. 3 6
      helper/mtopcard/mtopcard.php
  15. 0 4
      helper/refill/RefillBase.php
  16. 1 0
      helper/refill/XYZRefillFactory.php
  17. 5 2
      helper/refill/api/lingzh/aming/RefillPhone.php
  18. 27 21
      mobile/control/refill.php
  19. 3 3
      mobile/index.php
  20. 1 2
      mobile/kdniao_notify.php
  21. 2 0
      mobile/mobile_run.php
  22. 1 2
      mobile/refill_afand.php
  23. 1 4
      mobile/refill_afandeng.php
  24. 1 4
      mobile/refill_bdt.php
  25. 1 4
      mobile/refill_beixt.php
  26. 1 4
      mobile/refill_bjb.php
  27. 1 3
      mobile/refill_bxtwt.php
  28. 3 5
      mobile/refill_gftd.php
  29. 1 4
      mobile/refill_inner.php
  30. 1 4
      mobile/refill_jiec.php
  31. 1 3
      mobile/refill_saihu.php
  32. 1 3
      mobile/refill_suhcpdd.php
  33. 1 3
      mobile/refill_suhctm.php
  34. 1 3
      mobile/refill_tianjt.php
  35. 1 4
      mobile/refill_tianx.php
  36. 1 3
      mobile/refill_weit.php
  37. 1 3
      mobile/refill_xc.php
  38. 2 3
      mobile/refill_yifa.php
  39. 1 3
      mobile/refill_zzx.php
  40. 1 3
      mobile/util/errcode.php
  41. 1 35
      racc/control/merchant.php
  42. 2 1
      racc/index.php
  43. 14 2
      racc/racc.php
  44. 1 1
      test/TestRefill.php

+ 1 - 1
data/config/dev/base.ini.php

@@ -10,7 +10,7 @@ define('BONUS_EXPIRY_DATE',true);
 define('USE_BONUS_RATE',false);
 define('SERVER_TYPE','panda');
 define('CROSS_DOAMIN',true);
-define('COMPANY_NAME', 'LZKJ_COMPANY');
+define('COMPANY_NAME', 'XYZ_COMPANY');
 define('ZERO_GOODS_ID', 6245);
 
 $config = [];

+ 4 - 2
data/config/lingzh/base.ini.php

@@ -13,7 +13,6 @@ define('SERVER_TYPE','panda');
 define('COMPANY_NAME', 'LZKJ_COMPANY');
 define('ZERO_GOODS_ID', 8);
 
-
 $config = [];
 $config['base_site_url']        = SRV_HOST;
 $config['client_site_url']      = SRV_HOST;
@@ -100,7 +99,10 @@ $config['queue']['open'] = true;
 $config['queue']['host'] = QUEUEHOST;
 $config['queue']['port'] = 6379;
 $config['cache_open']    = true;
-$config['return_address'] = ['address' => '上海市金山区朱吕公路7335号','name' => "大熊猫(丽帆供应链)",'tel_phone' => '17301603655','zip_code' => '201600'];
+$config['return_address'] = ['address' => '上海市金山区朱吕公路7335号',
+                             'name' => "大熊猫(丽帆供应链)",
+                             'tel_phone' => '17301603655',
+                             'zip_code' => '201600'];
 $config['area_version'] = 5;
 
 $config['appjump_prefix'] = 'xyzshop://www.xyzshops.com';

+ 12 - 62
docker/compose/lz-acc/docker-compose.yml

@@ -38,8 +38,6 @@ services:
       - ../../conf/php/lz-mobile-spwan-start:/usr/local/bin/docker-spwan-start
     container_name: "panda-mobile"
     command: ['docker-spwan-start']
-    depends_on:
-      - "redisrv"
 
   raccsrv:
     image: php-zts-debug:7.3.18
@@ -54,21 +52,6 @@ services:
       - ../../conf/php/racc-spwan-start-lz:/usr/local/bin/docker-spwan-start
     container_name: "panda-racc"
     command: [docker-spwan-start]
-    depends_on:
-       - "redisrv"
-
-#  rdsrv:
-#    image: php-zts-debug:7.3.18
-#    volumes:
-#      - ../../conf/etc/localtime:/etc/localtime:ro
-#      - ../../../:/var/www/html
-#      - /nfs/upload:/var/www/html/data/upload
-#      - /mnt/shoplog:/var/www/html/data/log
-#      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-#    container_name: "panda-dispatcher"
-#    command: [php,"/var/www/html/rdispatcher/dispatcher.php","20"]
-#    depends_on:
-#      - "redisrv"
 
   websrv:
     image: php-fpm:alpine
@@ -83,48 +66,18 @@ services:
       - ../../conf/php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf
     container_name: "panda-web"
     command: [php-fpm]
-    depends_on:
-      - "redisrv"
-
-#  queuesrv:
-#    image: php-zts-debug:7.3.18
-#    volumes:
-#      - ../../conf/etc/localtime:/etc/localtime:ro
-#      - ../../../:/var/www/html
-#      - /nfs/upload:/var/www/html/data/upload
-#      - /mnt/shoplog:/var/www/html/data/log
-#      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-#    container_name: "panda-ue"
-#    command: [php,"/var/www/html/queue/index.php", "queue", "index"]
-#    depends_on:
-#      - "redisrv"
-
-#  searcher:
-#    image: php-zts-debug:7.3.18
-#    volumes:
-#      - ../../conf/etc/localtime:/etc/localtime:ro
-#      - ../../../:/var/www/html
-#      - /nfs/upload:/var/www/html/data/upload
-#      - /mnt/shoplog:/var/www/html/data/log
-#      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-#    container_name: "panda-searcher"
-#    command: [php, "/var/www/html/searcher.php"]
-#    depends_on:
-#      - "redisrv"
 
-#  crontabsrv:
-#    image: php-zts-debug:7.3.18
-#    volumes:
-#      - ../../conf/etc/localtime:/etc/localtime:ro
-#      - ../../../:/var/www/html
-#      - /nfs/upload:/var/www/html/data/upload
-#      - /mnt/shoplog:/var/www/html/data/log
-#      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-#      - ../../conf/crontab/root:/var/spool/cron/crontabs/root
-#    container_name: "panda-crontab"
-#    command: [crond,"-f"]
-#    depends_on:
-#      - "redisrv"
+  crontabsrv:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../../:/var/www/html
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
+      - ../../conf/crontab/root:/var/spool/cron/crontabs/root
+    container_name: "panda-crontab"
+    command: [crond,"-f"]
 
   phpcli:
     image: php-zts-debug:7.3.18
@@ -134,7 +87,4 @@ services:
       - ../../../:/var/www/html
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/shoplog:/var/www/html/data/log
-    container_name: "panda-php"
-    depends_on:
-      - "redisrv"
-      - "websrv"
+    container_name: "panda-php"

+ 0 - 129
docker/compose/lz-worker/docker-compose.yml

@@ -1,129 +0,0 @@
-version: "3.7"
-
-services:
-#  nginxsrv:
-#    image: nginx:alpine
-#    ports:
-#      - "80:80"
-#    volumes:
-#      - ../../../:/var/www/html
-#      - ../../conf/etc/localtime:/etc/localtime:ro
-#      - /mnt/upload:/var/www/html/data/upload
-#      - /mnt/merchant:/var/www/html/merchant
-#      - ../../conf/nginx/nginx-slave-http.conf:/etc/nginx/nginx.conf:ro
-#    container_name: "panda-nginx"
-#    command: [nginx,'-g','daemon off;']
-
-#  redisrv:
-#    image: redis:alpine
-#    ports:
-#      - "6379:6379"
-#    volumes:
-#      - ../../conf/etc/localtime:/etc/localtime:ro
-#      - ../../conf/redis/6379.conf:/etc/redis/redis.conf
-#      - /mnt/redisdata:/data
-#    container_name: "panda-redis"
-#    command: [redis-server,"/etc/redis/redis.conf"]
-
-#  mobilesrv:
-#    image: php-zts-debug:7.3.18
-#    ports:
-#      - "9100:9100"
-#    volumes:
-#      - ../../conf/etc/localtime:/etc/localtime:ro
-#      - ../../../:/var/www/html
-#      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-#      - /nfs/upload:/var/www/html/data/upload
-#      - /mnt/shoplog:/var/www/html/data/log
-#      - ../../conf/php/lz-mobile-spwan-start:/usr/local/bin/docker-spwan-start
-#    container_name: "panda-mobile"
-#    command: ['docker-spwan-start']
-#    depends_on:
-#      - "redisrv"
-
-#  raccsrv:
-#    image: php-zts-debug:7.3.18
-#    ports:
-#      - "9101:9101"
-#    volumes:
-#      - ../../conf/etc/localtime:/etc/localtime:ro
-#      - ../../../:/var/www/html
-#      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-#      - /nfs/upload:/var/www/html/data/upload
-#      - /mnt/shoplog:/var/www/html/data/log
-#      - ../../conf/php/racc-spwan-start-lz:/usr/local/bin/docker-spwan-start
-#    container_name: "panda-racc"
-#    command: [docker-spwan-start]
-#    depends_on:
-#       - "redisrv"
-
-  rdsrv:
-    image: php-zts-debug:7.3.18
-    volumes:
-      - ../../conf/etc/localtime:/etc/localtime:ro
-      - ../../../:/var/www/html
-      - /nfs/upload:/var/www/html/data/upload
-      - /mnt/shoplog:/var/www/html/data/log
-      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-    container_name: "panda-dispatcher"
-    command: [php,"/var/www/html/rdispatcher/dispatcher.php","20"]
-
-#  websrv:
-#    image: php-fpm:alpine
-#    ports:
-#      - "9000:9000"
-#    volumes:
-#      - ../../conf/etc/localtime:/etc/localtime:ro
-#      - ../../../:/var/www/html
-#      - /nfs/upload:/var/www/html/data/upload
-#      - /mnt/shoplog:/var/www/html/data/log
-#      - ../../conf/php-fpm/lz-php.ini:/usr/local/etc/php/php.ini
-#      - ../../conf/php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf
-#    container_name: "panda-web"
-#    command: [php-fpm]
-#    depends_on:
-#      - "redisrv"
-
-  queuesrv:
-    image: php-zts-debug:7.3.18
-    volumes:
-      - ../../conf/etc/localtime:/etc/localtime:ro
-      - ../../../:/var/www/html
-      - /nfs/upload:/var/www/html/data/upload
-      - /mnt/shoplog:/var/www/html/data/log
-      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-    container_name: "panda-queue"
-    command: [php,"/var/www/html/queue/index.php", "queue", "index"]
-
-  searcher:
-    image: php-zts-debug:7.3.18
-    volumes:
-      - ../../conf/etc/localtime:/etc/localtime:ro
-      - ../../../:/var/www/html
-      - /nfs/upload:/var/www/html/data/upload
-      - /mnt/shoplog:/var/www/html/data/log
-      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-    container_name: "panda-searcher"
-    command: [php, "/var/www/html/searcher.php"]
-
-  crontabsrv:
-    image: php-zts-debug:7.3.18
-    volumes:
-      - ../../conf/etc/localtime:/etc/localtime:ro
-      - ../../../:/var/www/html
-      - /nfs/upload:/var/www/html/data/upload
-      - /mnt/shoplog:/var/www/html/data/log
-      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-      - ../../conf/crontab/root:/var/spool/cron/crontabs/root
-    container_name: "panda-crontab"
-    command: [crond,"-f"]
-
-  phpcli:
-    image: php-zts-debug:7.3.18
-    volumes:
-      - ../../conf/etc/localtime:/etc/localtime:ro
-      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
-      - ../../../:/var/www/html
-      - /nfs/upload:/var/www/html/data/upload
-      - /mnt/shoplog:/var/www/html/data/log
-    container_name: "panda-php"

+ 0 - 1
docker/compose/stanley/docker-compose.yml

@@ -12,7 +12,6 @@ services:
       - /Users/stanley-king/work/WebProject/wapshop/dist:/var/www/html/mshop
       - ../../conf/nginx/cert:/etc/nginx/cert
       - ../../conf/nginx/nginx-stanley-http.conf:/etc/nginx/nginx.conf:ro
-
     container_name: "panda-nginx"
     command: [nginx,'-g','daemon off;']
 

+ 45 - 0
docker/compose/worker/docker-compose.yml

@@ -0,0 +1,45 @@
+version: "3.7"
+
+services:
+  rdsrv:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../../:/var/www/html
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
+    container_name: "panda-dispatcher"
+    command: [php,"/var/www/html/rdispatcher/dispatcher.php","20"]
+
+  queuesrv:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../../:/var/www/html
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
+    container_name: "panda-queue"
+    command: [php,"/var/www/html/queue/index.php", "queue", "index"]
+
+  searcher:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../../:/var/www/html
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
+    container_name: "panda-searcher"
+    command: [php, "/var/www/html/searcher.php"]
+
+  phpcli:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
+      - ../../../:/var/www/html
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+    container_name: "panda-php"

+ 91 - 0
docker/compose/xyz-acc/docker-compose.yml

@@ -0,0 +1,91 @@
+version: "3.7"
+
+services:
+  nginxsrv:
+    image: nginx:alpine
+    ports:
+      - "443:443"
+    volumes:
+      - ../../../:/var/www/html
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - /mnt/upload:/var/www/html/data/upload
+      - /mnt/merchant:/var/www/html/merchant
+      - ../../conf/nginx/cert:/etc/nginx/cert
+      - ../../conf/nginx/nginx-prod-https.conf:/etc/nginx/nginx.conf:ro
+    container_name: "panda-nginx"
+    command: [nginx,'-g','daemon off;']
+
+  redisrv:
+    image: redis:alpine
+    ports:
+      - "6379:6379"
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../conf/redis/6379.conf:/etc/redis/redis.conf
+      - /mnt/redisdata:/data
+    container_name: "panda-redis"
+    command: [redis-server,"/etc/redis/redis.conf"]
+
+  mobilesrv:
+    image: php-zts-debug:7.3.18
+    ports:
+      - "9100:9100"
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../../:/var/www/html
+      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - ../../conf/php/lz-mobile-spwan-start:/usr/local/bin/docker-spwan-start
+    container_name: "panda-mobile"
+    command: ['docker-spwan-start']
+
+  raccsrv:
+    image: php-zts-debug:7.3.18
+    ports:
+      - "9101:9101"
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../../:/var/www/html
+      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - ../../conf/php/racc-spwan-start-lz:/usr/local/bin/docker-spwan-start
+    container_name: "panda-racc"
+    command: [docker-spwan-start]
+
+  websrv:
+    image: php-fpm:alpine
+    ports:
+      - "9000:9000"
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../../:/var/www/html
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - ../../conf/php-fpm/lz-php.ini:/usr/local/etc/php/php.ini
+      - ../../conf/php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf
+    container_name: "panda-web"
+    command: [php-fpm]
+
+  crontabsrv:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../../:/var/www/html
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
+      - ../../conf/crontab/root:/var/spool/cron/crontabs/root
+    container_name: "panda-crontab"
+    command: [crond,"-f"]
+
+  phpcli:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - ../../conf/php/lz-php.ini:/usr/local/etc/php/php.ini
+      - ../../../:/var/www/html
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+    container_name: "panda-php"

+ 7 - 0
docker/conf/nginx/nginx-acc-http.conf

@@ -64,6 +64,13 @@ http
 	        try_files $uri $uri/ /mshop/index.html;
         }
 
+        location /merchant {
+            root $folder_name;
+            autoindex on;
+            index  index.html index.htm index.php;
+            try_files $uri $uri/ /merchant/index.html;
+        }
+
         location ~ /mobile/[/\w]+\.php$ {
             root           $folder_name;
             fastcgi_pass   172.16.110.28:9100;

+ 112 - 0
docker/conf/nginx/nginx-xyz-https.conf

@@ -0,0 +1,112 @@
+user nginx;
+worker_processes  8;
+error_log   /var/error.log  info;
+worker_rlimit_nofile 10240;
+
+events {
+    worker_connections  8192;
+    multi_accept on;
+    use epoll;
+}
+
+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       443 ssl;
+        set  $folder_name /var/www/html;
+        server_name www.xyzshops.cn;
+        root $folder_name;
+
+        ssl_certificate      cert/www.xyzshops.cn.pem;
+        ssl_certificate_key  cert/www.xyzshops.cn.key;
+
+        ssl_session_cache    shared:SSL:1m;
+        ssl_session_timeout  5m;
+
+        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;  #使用此加密套件。
+        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;   #使用该协议进行配置。
+        ssl_prefer_server_ciphers on;
+
+        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 /merchant {
+            root $folder_name;
+            autoindex on;
+            index  index.html index.htm index.php;
+            try_files $uri $uri/ /merchant/index.html;
+        }
+
+        location ~ /mobile/[/\w]+\.php$ {
+            root           $folder_name;
+            fastcgi_pass   121.89.223.81: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 ~ /racc/[/\w]+\.php$ {
+            root           $folder_name;
+            fastcgi_pass   121.89.223.81:9101;
+            fastcgi_index  index.php;
+            fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
+            include fastcgi_params;
+        }
+
+        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;
+        }
+    }
+}

+ 0 - 1
helper/fcgisrv/BaseServer.php

@@ -8,7 +8,6 @@ require_once(BASE_ROOT_PATH . '/helper/request_helper.php');
 
 use http_header;
 use Log;
-use performance_helper;
 use request_helper;
 
 

+ 9 - 8
helper/fcgisrv/LZRAccServer.php

@@ -4,31 +4,30 @@
 namespace fcgisrv;
 
 require_once(BASE_HELPER_PATH . '/fcgisrv/BaseServer.php');
-
+require_once(BASE_HELPER_PATH . '/refill/util.php');
 require_once(BASE_ROOT_PATH . '/helper/area_helper.php');
 require_once(BASE_CORE_PATH . '/framework/function/http.php');
 require_once(BASE_ROOT_PATH . '/helper/session_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/sensitive_word/dfa.php');
 require_once(BASE_ROOT_PATH . '/helper/exceptionex.php');
-require_once(BASE_HELPER_PATH . '/refill/util.php');
 require_once(BASE_PATH . '/control/merchant.php');
+require_once(BASE_PATH . '/control/lzbase.php');
 
 use Log;
 use Base;
-use UnSignException;
 use Exception;
-use merchantControl;
-use errcode;
 use LzException;
 
-
 class LZRAccServer extends BaseServer
 {
     public function __construct($subPath)
     {
         parent::__construct($subPath);
 
-        $exfiles = [];
+        $exfiles = [
+            'callback/lingzh/baizeyd.php','callback/lingzh/aming.php','callback/lingzh/binghc.php',
+            'callback/lingzh/ruishun.php','callback/lingzh/wuchen.php'
+        ];
 
         $this->setExFiles($exfiles);
     }
@@ -48,6 +47,7 @@ class LZRAccServer extends BaseServer
     {
         try
         {
+            Log::record("file is {$file}",Log::DEBUG);
             if(file_exists($file))
             {
                 if($this->is_exclude($file)) {
@@ -67,7 +67,8 @@ class LZRAccServer extends BaseServer
             echo ($ex->getMessage());
         }
         catch (Exception $ex) {
-            merchantControl::outerr($ex->getCode(),$ex->getMessage());
+            $msg = "{$ex->getCode()}|{$ex->getMessage()}|";
+            echo $msg;
             Log::record("run_looper exception catch code={$ex->getCode()} msg={$ex->getMessage()} trace={$ex->getTraceAsString()}",Log::ERR);
         }
     }

+ 8 - 9
helper/fcgisrv/MobileServer.php

@@ -9,16 +9,15 @@
 
 namespace fcgisrv;
 
-require_once (BASE_HELPER_PATH . '/fcgisrv/BaseServer.php');
-require_once (BASE_ROOT_PATH . '/helper/area_helper.php');
-require_once (BASE_CORE_PATH . '/framework/function/http.php');
-require_once (BASE_ROOT_PATH . '/mobile/index.php');
-require_once (BASE_ROOT_PATH . '/helper/session_helper.php');
+require_once(BASE_ROOT_PATH . '/helper/area_helper.php');
+require_once(BASE_CORE_PATH . '/framework/function/http.php');
+require_once(BASE_ROOT_PATH . '/mobile/index.php');
+require_once(BASE_ROOT_PATH . '/helper/session_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/sensitive_word/dfa.php');
-require_once(BASE_HELPER_PATH . '/session.php');
-require_once (BASE_ROOT_PATH . '/helper/session_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/exceptionex.php');
-require_once(BASE_MOBILE_PATH . '/util/errcode.php');
+require_once(BASE_ROOT_PATH . '/helper/session_helper.php');
+require_once(BASE_HELPER_PATH . '/fcgisrv/BaseServer.php');
+require_once(BASE_HELPER_PATH . '/session.php');
 
 use DFAFilter;
 use area_helper;
@@ -82,7 +81,7 @@ class MobileServer extends BaseServer
                     fcgi_header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE,PATCH');
                 }
 
-                if(self::is_exclude($file)) {
+                if($this->is_exclude($file)) {
                     Log::record("Call {$file}",Log::DEBUG);
                     include $file;
                 }

+ 4 - 11
helper/fcgisrv/RAccServer.php

@@ -3,17 +3,13 @@
 
 namespace fcgisrv;
 
-require_once(BASE_HELPER_PATH . '/fcgisrv/BaseServer.php');
-require_once(BASE_HELPER_PATH . '/refill/util.php');
-
 require_once(BASE_ROOT_PATH . '/helper/area_helper.php');
 require_once(BASE_CORE_PATH . '/framework/function/http.php');
 require_once(BASE_ROOT_PATH . '/helper/session_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/sensitive_word/dfa.php');
 require_once(BASE_ROOT_PATH . '/helper/exceptionex.php');
-
-require_once(BASE_PATH . '/control/merchant.php');
-require_once(BASE_PATH . '/control/lzbase.php');
+require_once(BASE_HELPER_PATH . '/fcgisrv/BaseServer.php');
+require_once(BASE_HELPER_PATH . '/refill/util.php');
 
 use Log;
 use Base;
@@ -22,15 +18,13 @@ use Exception;
 use merchantControl;
 use errcode;
 
-class RAccServer extends BaseServer
+class XYZRAccServer extends BaseServer
 {
     public function __construct($subPath)
     {
         parent::__construct($subPath);
 
         $exfiles = [
-            'callback/lingzh/baizeyd.php','callback/lingzh/aming.php','callback/lingzh/binghc.php',
-            'callback/lingzh/ruishun.php','callback/lingzh/wuchen.php'
         ];
 
         $this->setExFiles($exfiles);
@@ -40,13 +34,12 @@ class RAccServer extends BaseServer
     static public function instance()
     {
         if(self::$stInstance == NULL) {
-            self::$stInstance = new RAccServer('racc');
+            self::$stInstance = new XYZRAccServer('racc');
 
         }
         return self::$stInstance;
     }
 
-
     function handle_req($file)
     {
         try

+ 3 - 6
helper/mtopcard/mtopcard.php

@@ -137,12 +137,9 @@ function simple_card_type($cardno)
     elseif(preg_match( '/^9[0-9]{15}$/',$cardno,$matches)) {
         return PetroChinaCard;
     }
-    elseif (preg_match('/^134[0-8]\d{7}$|^(?:13[5-9]|147|15[0-27-9]|17[28]|18[2-478]|19[578])\d{8}$/', $cardno, $matches)) {
-        return ChinaMobileCard;
-    } elseif (preg_match('/^(?:13[0-2]|145|15[56]|166|17[156]|18[56]|196)\d{8}$/', $cardno, $matches)) {
-        return ChinaUnicomCard;
-    } elseif (preg_match('/^(?:133|149|153|177|173|18[019]|19[0139])\d{8}$/', $cardno, $matches)) {
-        return ChinaTelecomCard;
+    elseif(preg_match('/^1\d{10}$/',$cardno,$matches)) {
+        return PhoneCard;
+
     } else {
         return UnknownCard;
     }

+ 0 - 4
helper/refill/RefillBase.php

@@ -4,7 +4,6 @@ namespace refill;
 
 require_once(BASE_HELPER_PATH . '/queue/rdispatcher.php');
 require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
-require_once(BASE_HELPER_PATH . '/rbridge/RBridgeFactory.php');
 require_once(BASE_HELPER_PATH . '/refill/IRefill.php');
 require_once(BASE_HELPER_PATH . '/refill/IRefillOil.php');
 require_once(BASE_HELPER_PATH . '/refill/IRefillPhone.php');
@@ -14,14 +13,11 @@ require_once(BASE_HELPER_PATH . '/refill/CalcMerchantPrice.php');
 require_once(BASE_HELPER_PATH . '/refill/util.php');
 require_once(BASE_HELPER_PATH . '/refill/errcode.php');
 
-//require_once(BASE_HELPER_RAPI_PATH . '/api.php');
-
 use Log;
 use mtopcard;
 use QueueClient;
 use member_info;
 use Exception;
-use rbridge\RBridgeFactory;
 use trans_wapper;
 
 class RefillBase

+ 1 - 0
helper/refill/XYZRefillFactory.php

@@ -5,6 +5,7 @@ namespace refill;
 
 require_once(BASE_HELPER_PATH . '/refill/RefillBase.php');
 require_once(BASE_HELPER_PATH . '/refill/ProviderManager.php');
+require_once(BASE_HELPER_PATH . '/rbridge/RBridgeFactory.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/IPolicy.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/xyz/policy.php');
 

+ 5 - 2
helper/refill/api/lingzh/aming/RefillPhone.php

@@ -55,11 +55,14 @@ class RefillPhone extends refill\IRefillPhone
         $resp = http_request(config::QUERY_URL, $params , 'POST' , false);
         if ($resp === false) {
             return [false, '系统错误'];
-        } else {
+        }
+        else
+        {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
 
-            if ($resp['result'] == 'SUCCESS') {
+            if ($resp['result'] == 'SUCCESS')
+            {
                 $order_state = -1;
                 $data = $resp['data'];
                 if ($data['status'] == '充值成功') {

+ 27 - 21
mobile/control/refill.php

@@ -41,8 +41,7 @@ class refillControl extends merchantControl
         }
 
         $card_no = $_GET['cardno'];
-        $card_type = mtopcard\card_type($card_no);
-
+        $card_type = mtopcard\simple_card_type($card_no);
         if($card_type == mtopcard\UnknownCard) {
             return [false,'卡类型无法识别'];
         }
@@ -68,8 +67,7 @@ class refillControl extends merchantControl
         $card_no = $_GET['cardno'];
         $notify_url = $_GET['notifyurl'];
         $mch_order = $_GET['order_sn']; //对方的order编号
-        $idcard = $_GET['idcard'] ?? '';
-        $card_name = $_GET['card_name'] ?? '';
+        $quality = $_GET['quality'] ?? 1;
 
         if(!$this->check_mchorder($this->mchid(),$mch_order)) {
             return self::outerr(205,"客户订单号重复或者为空.");
@@ -79,28 +77,36 @@ class refillControl extends merchantControl
             return self::outerr(206,"平台不支持该卡充值.");
         }
 
-        $card_type = mtopcard\card_type($card_no);
-        if($card_type === mtopcard\SinopecCard || $card_type === mtopcard\PetroChinaCard)
-        {
-            $allow = refill\RefillFactory::instance()->allow($this->mchid(),$card_type,$amount);
-            if(!$allow) {
-                if ($card_type === mtopcard\SinopecCard) {
-                    $text = "中石化";
-                }
-                else {
-                    $text = "中石油";
-                }
-                return self::outerr(207,"今日贵司{$amount}{$text}充值库存已经用完.");
-            }
-        }
-
-        [$state, $err] = refill\RefillFactory::instance()->add($this->mchid(), $this->adminid(), $amount, $card_no, $mch_order, $idcard, $card_name, $notify_url,1,time(),0);
+//        $card_type = mtopcard\card_type($card_no);
+//        if($card_type === mtopcard\SinopecCard || $card_type === mtopcard\PetroChinaCard)
+//        {
+//            $allow = refill\RefillFactory::instance()->allow($this->mchid(),$card_type,$amount,$quality);
+//            if(!$allow) {
+//                if ($card_type === mtopcard\SinopecCard) {
+//                    $text = "中石化";
+//                }
+//                else {
+//                    $text = "中石油";
+//                }
+//                return self::outerr(207,"今日贵司{$amount}{$text}充值库存已经用完.");
+//            }
+//        }
+
+        $params = [ 'mchid' => $this->mchid(),
+            'buyer_id' => $this->adminid(),
+            'amount' => $amount,
+            'card_no' => $card_no,
+            'mch_order' => $mch_order,
+            'notify_url' => $notify_url,
+            'quality' => $quality];
+
+        $state = refill\util::push_add($params);
         if($state === true) {
             return self::outsuccess(['state' => true]);
         }
         else {
             $code = $state;
-            return self::outerr($code,$err);
+            return self::outerr($code,'提交失败');
         }
     }
 

+ 3 - 3
mobile/index.php

@@ -4,6 +4,6 @@
  *
  *
  */
-
-require_once (BASE_PATH . '/framework/function/function.php');
-require_once (BASE_PATH . '/control/control.php');
+require_once(BASE_PATH . '/util/errcode.php');
+require_once(BASE_PATH . '/framework/function/function.php');
+require_once(BASE_PATH . '/control/control.php');

+ 1 - 2
mobile/kdniao_notify.php

@@ -43,5 +43,4 @@ if (!empty($requestData))
                        'UpdateTime' => strftime("%Y-%m-%d %H:%M:%S",time()),
                        'Success' => $success,
                        'Reason' => $reson]));
-}
-?>
+}

+ 2 - 0
mobile/mobile_run.php

@@ -34,6 +34,8 @@ require_once(BASE_ROOT_PATH . '/helper/fcode/present_manager.php');
 require_once(BASE_ROOT_PATH . '/helper/url_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/activity_helper.php');
 require_once(BASE_HELPER_PATH . '/fcgisrv/MobileServer.php');
+require_once(BASE_HELPER_PATH . '/refill/util.php');
+
 
 function all_channels() {
     return ['ch_index','activity','goods','refill'];

+ 1 - 2
mobile/refill_afand.php

@@ -1,9 +1,8 @@
 <?php
 
 //捷充的回调接口
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
+refill\util::push_notify('afand',$_POST);
 
-refill\RefillFactory::instance()->notify('afand',$_POST);
 
 echo ('success');
 

+ 1 - 4
mobile/refill_afandeng.php

@@ -1,9 +1,6 @@
 <?php
 
-//捷充的回调接口
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('afandeng',$_POST);
+refill\util::push_notify('afandeng',$_POST);
 
 echo ('success');
 

+ 1 - 4
mobile/refill_bdt.php

@@ -1,7 +1,4 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('bdt',$_POST);
-
+refill\util::push_notify('bdt',$_POST);
 echo ('success');

+ 1 - 4
mobile/refill_beixt.php

@@ -1,10 +1,7 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
 $content = $_SERVER['post_content'];
 $input = json_decode($content,true);
-
-refill\RefillFactory::instance()->notify('beixt',$input);
+refill\util::push_notify('beixt',$_POST);
 
 echo ('ok');

+ 1 - 4
mobile/refill_bjb.php

@@ -1,7 +1,4 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('bjb',$_POST);
-
+refill\util::push_notify('bjb',$_POST);
 echo ('ok');

+ 1 - 3
mobile/refill_bxtwt.php

@@ -1,10 +1,8 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
 $content = $_SERVER['post_content'];
 $input = json_decode($content,true);
 
-refill\RefillFactory::instance()->notify('bxtwt',$input);
+refill\util::push_notify('bxtwt',$_POST);
 
 echo ('ok');

+ 3 - 5
mobile/refill_gftd.php

@@ -1,10 +1,8 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
 $content = $_SERVER['post_content'];
 $input = json_decode($content,true);
-refill\RefillFactory::instance()->notify('gftd',$input);
 
-$ret = ['state' => "success"];
-echo (json_encode($ret));
+refill\util::push_notify('gftd',$_POST);
+
+echo (json_encode(['state' => "success"]));

+ 1 - 4
mobile/refill_inner.php

@@ -1,9 +1,6 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
 $channel_name = $_POST['channel_name'];
-
-refill\RefillFactory::instance()->notify($channel_name,$_POST);
+refill\util::push_notify($channel_name,$_POST);
 
 echo ('success');

+ 1 - 4
mobile/refill_jiec.php

@@ -1,9 +1,6 @@
 <?php
 
-//捷充的回调接口
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('jiec',$_POST);
+refill\util::push_notify('jiec',$_POST);
 
 echo ('success');
 

+ 1 - 3
mobile/refill_saihu.php

@@ -1,8 +1,6 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('saihu',$_POST);
+refill\util::push_notify('saihu',$_POST);
 
 echo ('success');
 

+ 1 - 3
mobile/refill_suhcpdd.php

@@ -1,8 +1,6 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('suhcpdd',$_POST);
+refill\util::push_notify('suhcpdd',$_POST);
 
 echo ('SUCCESS');
 

+ 1 - 3
mobile/refill_suhctm.php

@@ -1,8 +1,6 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('suhctm',$_POST);
+refill\util::push_notify('suhctm',$_POST);
 
 echo ('SUCCESS');
 

+ 1 - 3
mobile/refill_tianjt.php

@@ -1,8 +1,6 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('tianjt',$_POST);
+refill\util::push_notify('tianjt',$_POST);
 
 echo ('SUCCESS');
 

+ 1 - 4
mobile/refill_tianx.php

@@ -1,9 +1,6 @@
 <?php
 
-//捷充的回调接口
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('tianx',$_POST);
+refill\util::push_notify('tianx',$_POST);
 
 echo ('success');
 

+ 1 - 3
mobile/refill_weit.php

@@ -1,7 +1,5 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('weit',$_POST);
+refill\util::push_notify('weit',$_POST);
 
 echo ('success');

+ 1 - 3
mobile/refill_xc.php

@@ -1,7 +1,5 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('xc',$_POST);
+refill\util::push_notify('xc',$_POST);
 
 echo ('success');

+ 2 - 3
mobile/refill_yifa.php

@@ -1,10 +1,9 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
 $content = $_SERVER['post_content'];
 $input = json_decode($content,true);
-refill\RefillFactory::instance()->notify('yifa',$input);
+
+refill\util::push_notify('yifa',$_POST);
 
 echo ('success');
 

+ 1 - 3
mobile/refill_zzx.php

@@ -1,8 +1,6 @@
 <?php
 
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-refill\RefillFactory::instance()->notify('zzx',$_POST);
+refill\util::push_notify('zzx',$_POST);
 
 echo ('success');
 

+ 1 - 3
mobile/util/errcode.php

@@ -228,6 +228,4 @@ class errcode //extends SplEnum
                 return '系统错误.';
         }
     }
-}
-
-?>
+}

+ 1 - 35
racc/control/merchant.php

@@ -1,6 +1,5 @@
 <?php
 
-
 class merchantControl
 {
     private $mMchid;
@@ -48,22 +47,6 @@ class merchantControl
         return $this->mAdminid;
     }
 
-    private function pubKey($mchid)
-    {
-        static $pubs = [];
-
-        if(array_key_exists($mchid,$pubs)) {
-            return $pubs[$mchid];
-        }
-        else {
-            $pub_key = BASE_DATA_PATH . "/api/merchant/key/{$mchid}_pub.pem";
-            $key = file_get_contents($pub_key);
-            $pub = openssl_get_publickey($key);
-            $pubs[$mchid] = $pub;
-            return $pub;
-        }
-    }
-
     private function verify_md5($key)
     {
         $input = $_GET;
@@ -81,24 +64,6 @@ class merchantControl
         return ($sign == md5($body));
     }
 
-    private function verify_rsa($mchid)
-    {
-        $pub = $this->pubKey($mchid);
-        if(empty($pub)) {
-            return false;
-        }
-        $input = $_GET;
-        $sign = $input['sign'];
-        $input['sign'] = null;
-        $input['from'] = null;
-
-        $data = $this->sign_body($input);
-        $res = openssl_verify($data,base64_decode($sign),$pub);
-        Log::record("openssl_verify res={$res}",Log::DEBUG);
-
-        return ($res == 1);
-    }
-
     protected function check_empty($value)
     {
         if (!isset($value))
@@ -138,6 +103,7 @@ class merchantControl
         joutput_data($data);
         return true;
     }
+
     public static function outerr($code, $msg = '')
     {
         joutput_error($code, $msg);

+ 2 - 1
racc/index.php

@@ -5,4 +5,5 @@
  *
  */
 
-require_once (BASE_PATH . '/control/merchant.php');
+require_once(BASE_PATH . '/control/merchant.php');
+require_once(BASE_PATH . '/control/lzbase.php');

+ 14 - 2
racc/racc.php

@@ -34,7 +34,6 @@ require_once(BASE_ROOT_PATH . '/helper/third_author/wxauthor.php');
 require_once(BASE_ROOT_PATH . '/helper/fcode/present_manager.php');
 require_once(BASE_ROOT_PATH . '/helper/url_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/activity_helper.php');
-require_once(BASE_HELPER_PATH . '/fcgisrv/RAccServer.php');
 require_once(BASE_HELPER_PATH . '/refill/util.php');
 
 function all_channels() {
@@ -50,4 +49,17 @@ StatesHelper::init();
 $listener = new message\subscriber($gMessageStates);
 $listener->start();
 
-fcgisrv\RAccServer::instance()->run_looper();
+if(defined('COMPANY_NAME') && COMPANY_NAME == 'LZKJ_COMPANY') {
+    require_once(BASE_HELPER_PATH . '/fcgisrv/LZRAccServer.php');
+    Log::record("fcgisrv\LZRAccServer start",Log::DEBUG);
+    fcgisrv\LZRAccServer::instance()->run_looper();
+}
+elseif(defined('COMPANY_NAME') && COMPANY_NAME == 'XYZ_COMPANY') {
+    require_once(BASE_HELPER_PATH . '/fcgisrv/XYZRAccServer.php');
+    Log::record("fcgisrv\XYZRAccServer start",Log::DEBUG);
+    fcgisrv\XYZRAccServer::instance()->run_looper();
+}
+else {
+    Log::record("fcgisrv Not any server can start",Log::DEBUG);
+}
+

+ 1 - 1
test/TestRefill.php

@@ -44,6 +44,7 @@ class TestRefill extends TestCase
     public static function setUpBeforeClass(): void
     {
         Base::run_util();
+        refill\RefillFactory::instance();
     }
 
     public function testFactory()
@@ -740,7 +741,6 @@ class TestRefill extends TestCase
             'amount' => "1000",
             "act" => "refill",
             "op" => "add",
-            'card_name' => '江海苗',
             'order_sn' => $this->make_sn(),
             'notifyurl' => $notifyurl];