ayHaru 4 vuotta sitten
vanhempi
commit
4f0d4d6904

+ 4 - 0
application/common.php

@@ -32,6 +32,10 @@ function json_return($code,$data=[],$msg='')
     exit(json_encode(['code'=>$code,'data'=>$data,'msg'=>$msg],JSON_UNESCAPED_UNICODE ));
 }
 
+function json_success($data,$msg='ok'){
+    exit(json_encode(['code'=>0,'data'=>$data,'msg'=>$msg],JSON_UNESCAPED_UNICODE ));
+}
+
 /**
  * php发送http请求
  * @param array $params 相关请求参数

+ 28 - 1
application/index/controller/Index.php

@@ -4,9 +4,36 @@ namespace app\index\controller;
 
 class Index extends base
 {
+    const admin_url = '192.168.1.200:8080';
+    const path_check_order = '/CheckRcode';
+
+    protected function request($params)
+    {
+
+    }
+
     public function index()
     {
         echo 'index';
     }
-
+    public function CheckOrder(){
+        $order_sn = input('param.order_sn');
+        $ret = ['existed' => true,'order_sn' => $order_sn];
+        json_success($ret);
+    }
+    public function CheckFcode(){
+        $code = input('param.code');
+        $trunk = 1;
+        $cabinet = 2;
+        $ret = ['existed' => true,'code' => $code , 'trunk' => $trunk , 'cabinet' => $cabinet];
+        json_success($ret);
+    }
+    public function RecordStore(){
+        $order_sn = input('param.order_sn');
+        json_success([]);
+    }
+    public function RecordFetch(){
+        $order_sn = input('param.order_sn');
+        json_success([]);
+    }
 }

+ 0 - 16
application/index/controller/base.php

@@ -1,16 +0,0 @@
-<?php
-
-
-namespace app\index\controller;
-
-
-class base
-{
-    const admin_url = '192.168.1.200:8080/index.php';
-    const path_check_order = '/index/order/check_rcode';
-
-    protected function request($params)
-    {
-
-    }
-}

+ 0 - 15
application/index/controller/order.php

@@ -1,15 +0,0 @@
-<?php
-
-namespace app\index\controller;
-
-class order extends base
-{
-    public function check_rcode()
-    {
-        $order_sn = input('param.order_sn');
-        $url = base::admin_url . base::path_check_order;
-        $resp = http_get($url,['order_sn' => $order_sn]);
-
-        echo $resp;
-    }
-}

+ 4 - 1
conf/nginx/nginx-debug-http.conf

@@ -29,7 +29,7 @@ http
     {
     	listen       8088;
         set  $folder_name /var/www/html/public;
-        server_name 192.168.1.200;
+        server_name 127.0.0.1;
         root $folder_name;
         index index.html index.php; 
     	client_max_body_size 100m;
@@ -54,6 +54,9 @@ http
         location / {
             index  index.html index.htm index.php;
         }
+        if (!-e $request_filename) {
+            rewrite  ^(.*)$  /index.php?s=/$1  last;
+        }
         location ~ \.php {
 	        add_header Cache-Control no-store;
 	        set  $folder_name /var/www/html/public;

+ 24 - 0
docker-compose-test.yml

@@ -43,3 +43,27 @@ services:
       - $PWD/conf/etc/localtime:/etc/localtime:ro
     container_name: "acc-redis"
     command: [ "redis-server"]
+
+  accqueue:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - $PWD/conf/etc/localtime:/etc/localtime:ro
+      - $PWD:/var/www/html
+      - $PWD/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
+      - $PWD/conf/queue/docker-queue-start:/usr/local/bin/docker-queue-start
+    container_name: "acc-queue"
+    command: [docker-queue-start]
+    extra_hosts:
+      - "docker.hostip:172.18.0.1"
+      - "eth.hostip:172.17.153.106"
+
+  acccrontab:
+    image: php-zts-debug:7.3.18
+    volumes:
+        - $PWD/conf/etc/localtime:/etc/localtime:ro
+        - $PWD:/var/www/html
+        - $PWD/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
+        - $PWD/conf/crontab/root:/var/spool/cron/crontabs/root
+        - $PWD/conf/crontab/docker-start:/usr/local/bin/docker-start
+    container_name: "acc-crontab"
+    command: [docker-start]

+ 0 - 3
queue/config.ini.php

@@ -1,3 +0,0 @@
-<?php
-
-require_once(BASE_PATH . '/config.windows.php');

+ 5 - 0
queue/config.test.php

@@ -1 +1,6 @@
 <?php
+
+$config['net_queue']['name'] = 'net_access_queue';
+$config['net_queue']['host'] = 'docker.hostip';
+//$config['net_queue']['host'] = '192.168.1.195';
+$config['net_queue']['port'] = 6380;

+ 7 - 5
route/route.php

@@ -1,6 +1,8 @@
 <?php
-
-
-return [
-
-];
+Route::group('/',array(
+    'index'                => 'index/index/index',
+    'CheckOrder'                => 'index/index/CheckOrder',
+    'CheckFcode'                => 'index/index/CheckFcode',
+    'RecordStore'               => 'index/index/RecordStore',
+    'RecordFetch'               => 'index/index/RecordFetch',
+));