Quellcode durchsuchen

merchant admin update

ayHaru vor 4 Jahren
Ursprung
Commit
1bc34b75f9

+ 7 - 0
conf/nginx/nginx-prod-https.conf

@@ -71,6 +71,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/ /index.html;
+        }
+
         location ~ /mobile/[/\w]+\.php$ {
             root           $folder_name;
             fastcgi_pass   mobilesrv:9100;

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

@@ -9,7 +9,7 @@ define('LOCAL_DEBUG',false);
 define('BONUS_EXPIRY_DATE',true);
 define('USE_BONUS_RATE',false);
 define('SERVER_TYPE','panda');
-
+define('CROSS_DOAMIN',true);
 define('COOKIE_DOMAIN','192.168.1.195');
 define('NET_IP','111.193.234.45');
 

+ 3 - 1
data/model/merchant.model.php

@@ -54,7 +54,9 @@ class merchantModel extends Model
                 $list[$key]['add_time'] = date('Y-m-d H:i:s', $value['add_time']);
             }
             $list[$key]['status_text'] = $check_status[$value['status']-1];
-            $list[$key]['voucher_path'] = UPLOAD_SITE_URL.'/'.ATTACH_REFILL_EVIDENCE.DS.$value['voucher'];
+            if($value['voucher_name']){
+                $list[$key]['voucher_path'] = UPLOAD_SITE_URL.'/'.ATTACH_UPFILE.DS.$value['voucher_name'];
+            }
         }
         return $list;
     }

+ 7 - 7
docker-compose-win.yml

@@ -8,7 +8,7 @@ services:
     volumes:
       - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
       - /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/data/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-win-http.conf:/etc/nginx/nginx.conf:ro
     links:
@@ -34,7 +34,7 @@ services:
       - /d/phpstudy_pro/WWW/xyzshop/conf/etc/localtime:/etc/localtime:ro
       - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
       - /d/phpstudy_pro/WWW/xyzshop/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
-      - /d/phpstudy_pro/WWW/xyzshop/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
       - /d/phpstudy_pro/WWW/xyzshop/conf/php/docker-php-spwan-start:/usr/local/bin/docker-spwan-start
     links:
       - redisrv
@@ -49,7 +49,7 @@ services:
       volumes:
         - /d/phpstudy_pro/WWW/xyzshop/conf/etc/localtime:/etc/localtime:ro
         - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
-        - /d/phpstudy_pro/WWW/xyzshop/upload:/var/www/html/data/upload
+        - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
         - /d/phpstudy_pro/WWW/xyzshop/conf/php-fpm/php-debug.ini:/usr/local/etc/php/php.ini
         - /d/phpstudy_pro/WWW/xyzshop/conf/php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf
       container_name: "panda-web"
@@ -63,7 +63,7 @@ services:
     volumes:
       - /d/phpstudy_pro/WWW/xyzshop/conf/etc/localtime:/etc/localtime:ro
       - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
-      - /d/phpstudy_pro/WWW/xyzshop/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
       - /d/phpstudy_pro/WWW/xyzshop/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
     links:
       - redisrv
@@ -77,7 +77,7 @@ services:
     volumes:
       - /d/phpstudy_pro/WWW/xyzshop/conf/etc/localtime:/etc/localtime:ro
       - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
-      - /d/phpstudy_pro/WWW/xyzshop/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
       - /d/phpstudy_pro/WWW/xyzshop/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
     links:
       - redisrv
@@ -91,7 +91,7 @@ services:
       volumes:
         - /d/phpstudy_pro/WWW/xyzshop/conf/etc/localtime:/etc/localtime:ro
         - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
-        - /d/phpstudy_pro/WWW/xyzshop/upload:/var/www/html/data/upload
+        - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
         - /d/phpstudy_pro/WWW/xyzshop/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
         - /d/phpstudy_pro/WWW/xyzshop/conf/crontab/debug-root:/var/spool/cron/crontabs/root
       links:
@@ -106,7 +106,7 @@ services:
       - /d/phpstudy_pro/WWW/xyzshop/conf/etc/localtime:/etc/localtime:ro
       - /d/phpstudy_pro/WWW/xyzshop/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
       - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
-      - /d/phpstudy_pro/WWW/xyzshop/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
     links:
       - redisrv
     container_name: "panda-php"

+ 1 - 0
docker-compose.yml

@@ -10,6 +10,7 @@ services:
       - $PWD/conf/etc/localtime:/etc/localtime:ro
       - /mnt/upload:/var/www/html/data/upload
       - /mnt/wapshop:/var/www/html/mshop
+      - /mnt/merchant:/var/www/html/merchant
       - $PWD/conf/nginx/cert:/etc/nginx/cert
       - $PWD/conf/nginx/nginx-prod-https.conf:/etc/nginx/nginx.conf:ro
     links:

+ 1 - 0
global.php

@@ -63,6 +63,7 @@ define('ATTACH_MOBILE','mobile');
 define('ATTACH_CIRCLE','circle');
 define('ATTACH_CMS','cms');
 define('ATTACH_LIVE','live');
+define('ATTACH_UPFILE','upfile');
 define('ATTACH_REFILL_EVIDENCE','refill_evidence');
 define('ATTACH_MALBUM', ATTACH_PATH.'/member');
 define('ATTACH_MQRCODE',ATTACH_PATH.'/qrcode');

+ 2 - 4
mobile/control/merchant_base.php

@@ -10,10 +10,8 @@ class merchant_baseControl
 
     public function __construct()
     {
-        if(empty($_SESSION['client_type'])){
-            $_SESSION['client_type'] = $_GET['client_type'];
-        }
-        if($_GET['act'] != 'merchant_login' || $_GET['act'] != 'merchant_recharge'){
+        $_SESSION['client_type'] = $_GET['client_type'];
+        if($_GET['act'] != 'merchant_login'){
             if (empty($_SESSION['mch_id'])) {
                 throw new UnloginException();
             }

+ 1 - 1
mobile/control/merchant_info.php

@@ -46,7 +46,7 @@ class merchant_infoControl extends merchant_baseControl
     }
     public function ipdelOp(){
         $ip = $_POST['ip'];
-        if (empty($ip_key)){
+        if (empty($ip)){
             return self::outerr(errcode::ErrParamter , "参数错误" );
         }
         $ip = trim($ip);

+ 8 - 17
mobile/control/merchant_recharge.php

@@ -35,28 +35,19 @@ class merchant_rechargeControl extends merchant_baseControl
         if(!isset($params['voucher']) || empty($params['voucher'])){
             return self::outerr(errcode::ErrParamter , "凭证名称有误" );
         }
-        $params['mch_id'] = $_SESSION['mch_id'];
-        $params['member_id'] = $_SESSION['member_id'];
+        $ins['amount'] = $params['amount'];
+        $ins['bank_username'] = $params['bank_username'];
+        $ins['bank_name'] = $params['bank_name'];
+        $ins['voucher_name'] = $params['voucher'];
+        $ins['mch_id'] = $_SESSION['mch_id'];
+        $ins['member_id'] = $_SESSION['member_id'];
+        $ins['add_time'] = time();
         $model_merchant = Model('merchant');
-        $ret = $model_merchant->addRechargeApply($params);
+        $ret = $model_merchant->addRechargeApply($ins);
         if($ret){
             return self::outsuccess([]);
         }else{
             return self::outerr(errcode::ErrOperation, "系统错误.");
         }
     }
-    public function voucheruploadOp(){
-        if (!empty($_FILES['voucher']['name'])) {
-            $upload = new UploadFile();
-            $upload->set('default_dir',ATTACH_REFILL_EVIDENCE);
-            $result = $upload->upfile('voucher');
-            if ($result) {
-                $result['voucher'] = $upload->file_name;
-                $result['voucher_url'] = UPLOAD_SITE_URL.'/'.ATTACH_REFILL_EVIDENCE.DS.$upload->file_name;
-                return self::outsuccess($result);
-            }else {
-                return self::outerr(errcode::ErrParamter , "凭证有误:{$upload->error}" );
-            }
-        }
-    }
 }

+ 3 - 3
upfile.php

@@ -1,5 +1,5 @@
 <?php
-
+define('BASE_ROOT_PATH',str_replace('\\','/',dirname(__FILE__)));
 require_once(BASE_ROOT_PATH . '/global.php');
 function upfile_joutput_data($datas)
 {
@@ -46,7 +46,7 @@ function create_uuid($prefix = "") {
     return $prefix . $uuid;
 }
 
-if ($_POST)
+if ($_FILES)
 {
     $base_path = BASE_ROOT_PATH . '/data/upload/upfile';
     $base_site_path = '/data/upload/upfile';
@@ -63,7 +63,7 @@ if ($_POST)
         $dest_file = $base_path . '/' . $filename;
         $result = move_uploaded_file($_FILES["file"]["tmp_name"],$dest_file);
         if ($result) {
-            $ret['file_path'] = $dest_file;
+            $ret['file_path'] = $filename;
             $ret['file_site_path'] = $base_site_path .'/' . $filename;
             upfile_joutput_data($ret);
         } else {