瀏覽代碼

Merge branch 'sess_0306' of 121.43.114.153:/home/git/repositories/shopnc into sess_0306

tiams@foxmail.com 9 年之前
父節點
當前提交
12b9acf3bb

+ 79 - 0
data/config/config.ini.php

@@ -0,0 +1,79 @@
+<?php
+
+defined('InShopNC') or exit('Access Invalid!');
+
+//define('USE_REMOTE_IMAGE',true);
+define('DEBUG_MODE',true);
+$config = array();
+
+//const test_srv_host = 'http://121.43.114.153';
+$SRV_HOST = 'http://192.168.1.110';
+$REMOTE_IMG_HOST = 'http://p.lrlz.com';
+
+$config['base_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';
+
+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']       = '127.0.0.1';
+$config['db']['1']['dbport']       = '3306';
+$config['db']['1']['dbuser']       = 'root';
+$config['db']['1']['dbpwd']        = '55668899';
+$config['db']['1']['dbname']       = 'shopnc';
+$config['db']['1']['dbcharset']    = 'UTF-8';
+$config['db']['slave']             = $config['db']['master'];
+$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';//'file';
+$config['redis']['prefix']      	= 'nc_';
+$config['redis']['master']['port']     	= 6379;
+$config['redis']['master']['host']     	= '127.0.0.1';
+$config['redis']['master']['pconnect'] 	= 0;
+$config['redis']['slave']      	    = array();
+//$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://127.0.0.1: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'] = false;
+$config['queue']['host'] = '127.0.0.1';
+$config['queue']['port'] = 6379;
+$config['cache_open'] = true;
+
+$config['delivery_site_url']    = $SRV_HOST.'/delivery';

+ 5 - 5
data/model/user_bonus.model.php

@@ -58,7 +58,7 @@ class user_bonusModel extends Model
         return $this->where($condition)->field($fields)->limit(false)->select();
     }
 
-    public function getAllBind($mobile,$fields = '*') {
+    public function getBinded($mobile,$fields = '*') {
         return  $this->where(array('user_mobile' => $mobile, 'bonus_status' => 2))->field($fields)->order('type_id')->select();
     }
 
@@ -71,8 +71,8 @@ class user_bonusModel extends Model
         }
     }
 
-    private function getBind($mobile,$type_id,$fields = '*') {
-        return  $this->where(array('user_mobile' => $mobile, 'type_id' => $type_id,'bonus_status' => 2))->field($fields)->find();
+    private function getOwned($mobile,$type_id,$fields = '*') {
+        return  $this->where(array('user_mobile' => $mobile, 'type_id' => $type_id,'bonus_status' => array('in',array(2,3))))->field($fields)->find();
     }
 
     public function edit($condition,$datas)
@@ -96,7 +96,7 @@ class user_bonusModel extends Model
             //如果已经绑定手机
             if(!empty($mobile))
             {
-                $bonus = $this->getBind($mobile,$type_id,$fields);
+                $bonus = $this->getOwned($mobile,$type_id,$fields);
                 if(!empty($bonus)) {
                     return $bonus;
                 }
@@ -165,7 +165,7 @@ class user_bonusModel extends Model
         {
             $fields = '*';
             //如果已经绑定手机
-            $items = $this->getBind($mobile,$type_id,$fields);
+            $items = $this->getOwned($mobile,$type_id,$fields);
             if(!empty($items)) {
                 $bonus = $items;
                 return false;

+ 5 - 2
data/resource/mobile/bonus/js/tel.js

@@ -176,6 +176,7 @@ $(function(){
                                         var alink = $("#url").val();
                                         var other_html='';
                                         var html='';
+
                                         var ser = function binded_info(){
                                             function   formatDate(now)   {
                                                 //var   year=now.getYear()+1900;
@@ -192,6 +193,8 @@ $(function(){
                                             var mine_bonus_sn=data.datas.mine_bonus.bonus_sn;
                                             var mine_bonus_value = data.datas.mine_bonus.bonus_value;
                                             var comment=data.datas.binded_info;
+                                            //红包金额
+                                            $('.price span').text(mine_bonus_value);
 
                                             for(var i=0;i<other_ser.length;i++){
                                                 var king_icon='',
@@ -220,7 +223,7 @@ $(function(){
                                                     '<p style="color:#9b9b9b">'+user_comment+'</p>'+
                                                     '</div>'+
                                                     '<div class="li_right">'+
-                                                    '<p class="p">'+other_ser[i].bonus_value+'</p>'+
+                                                    '<p class="p">'+other_ser[i].bonus_value+'</p>'+
                                                     '<p class="king_box">'+king_icon+'</p>'+
                                                     '</div>'+
                                                     '</div>';
@@ -273,7 +276,7 @@ $(function(){
             }),function (data, status) {
                 return false;
             };
-            $('#message').text(msg).attr('color','9b9b9b');
+            $('#message').text(msg).css('color','#9b9b9b');
             $('#bomb').remove();
         }
     });

+ 1 - 1
fcgi_run.php

@@ -6,7 +6,7 @@ define('MOBILE_SERVER',true);
 require_once (BASE_ROOT_PATH . '/fooder.php');
 require_once (BASE_ROOT_PATH . '/helper/http_header.php');
 require_once (BASE_ROOT_PATH . '/helper/session.php');
-require_once (BASE_ROOT_PATH . '/helper/func.php');
+require_once (BASE_ROOT_PATH . '/helper/img_helper.php');
 require_once (BASE_ROOT_PATH . '/helper/exceptionex.php');
 require_once (BASE_ROOT_PATH . '/helper/fcgi_server.php');
 

+ 2 - 1
helper/bonus/manager.php

@@ -182,7 +182,8 @@ class manager
             'user_name' => user_helper::nickname());
 
         $ret = $mod_user_bonus->where(array('bonus_id' => $bonus['bonus_id']))->update($datas);
-        if($ret == true) {
+        $affect_rows = $this->affected_rows();
+        if($ret == true && $affect_rows == 1) {
             array_merge($bonus,$datas);
             $this->write_session($bonus);
         }

+ 1 - 1
helper/bonus_helper.php

@@ -106,7 +106,7 @@ class bonus_helper
     static public function topup_bonus($mobile)
     {
         $mod_bonus = Model('user_bonus');
-        $bind_bonus = $mod_bonus->getAllBind($mobile);
+        $bind_bonus = $mod_bonus->getBinded($mobile);
         if(empty($bind_bonus)) {
             return false;
         }

+ 1 - 1
helper/func.php

@@ -6,7 +6,7 @@
  * Date: 2016/2/18
  * Time: 17:47
  */
-class func
+class image_helper
 {
     // 添加图片路径
     public static function format_brand_img($filename)

+ 38 - 13
helper/predeposit_helper.php

@@ -48,6 +48,20 @@ class predeposit_helper
         $this->model_pd->changePd("bonus_add_money", $data);
     }
 
+    public function pay_add_money($paysn,$total_fee)
+    {
+
+//        $data = array();
+//        $data['member_id'] = $member_info['member_id'];
+//        $data['member_name'] = $member_info['member_name'];
+//        $data['amount'] = $money;
+//        $data['order_sn'] = $order_sn;
+//        $data['admin_name'] = $bonusname;
+//        $data['pdr_sn'] = $order_sn;
+//        $data['lg_desc'] = $memo;
+//        $model_pd->changePd("bonus_add_money", $data);
+    }
+
     public function hand_out_bonus($amount,$bonus_sn,$sender_name,$info) {
         $data = array();
         $data['member_id'] = $_SESSION['member_id'];
@@ -89,43 +103,54 @@ class predeposit_helper
 
             $fAdd = true;
             if($type == 'order_pay') {
-                $item['title'] = "支付订单:{$sn}";
+                $item['title'] = "支付订单";
+                $item['sn'] = "订单号:{$sn}";
             }
             else if($type == 'order_freeze') {
-                $item['title'] = "下单,冻结预存款,订单号:{$sn}";
+                $item['title'] = "下单,冻结预存款";
+                $item['sn'] = "订单号:{$sn}";
             }
             else if($type == 'order_cancel') {
-                $item['title'] = "取消订单,解冻预存款,订单号:{$sn}";
+                $item['title'] = "取消订单,解冻预存款";
+                $item['sn'] = "订单号:{$sn}";
             }
             else if($type == 'order_comb_pay') {
-                $item['title'] = "下单,支付被冻结的预存款,订单号:{$sn}";
+                $item['title'] = "下单,支付被冻结的预存款";
+                $item['sn'] = "订单号:{$sn}";
             }
             else if($type == 'recharge') {
-                $item['title'] = "充值,充值单号:{$sn}";
+                $item['title'] = "充值";
+                $item['sn'] = "充值单号:{$sn}";
             }
             else if($type == 'refund') {
-                $item['title'] = "确认退款,订单号:{$sn}";
+                $item['title'] = "确认退款";
             }
             else if($type == 'vr_refund') {
-                $item['title'] = "虚拟兑码退款成功,订单号:{$sn}";
+                $item['title'] = "虚拟兑码退款成功";
             }
             else if($type == 'hand_out_bonus') {
-                $item['title'] = "发出红包,红包号:{$sn}";
+                $item['title'] = "发出红包";
+                $item['sn'] = '';
             }
             else if($type == 'bonus_add_money') {
-                $item['title'] = "{$admin_name}的红包,红包号:{$sn}";
+                $item['title'] = "{$admin_name}的红包";
+                $item['sn'] = '';
             }
             else if($type == 'sys_add_money') {
-                $item['title'] = "管理员调节预存款,充值单号:{$sn}";
+                $item['title'] = "管理员调节预存款";
+                $item['sn'] = '';
             }
             else if($type == 'sys_del_money') {
-                $item['title'] = "管理员调节预存款,充值单号:{$sn}";
+                $item['title'] = "管理员调节预存款";
+                $item['sn'] = '';
             }
             else if($type == 'sys_freeze_money') {
-                $item['title'] = "管理员冻结预存款,充值单号:{$sn}";
+                $item['title'] = "管理员冻结预存款";
+                $item['sn'] = "充值单号:{$sn}";
             }
             else if($type == 'sys_unfreeze_money') {
-                $item['title'] = "管理员解冻预存款,充值单号:{$sn}";
+                $item['title'] = "管理员解冻预存款";
+                $item['sn'] = "充值单号:{$sn}";
             }
             else {
                 $fAdd = false;

+ 80 - 2
helper/sensitive/DFAItem.php

@@ -8,10 +8,88 @@
 
 namespace sensitive_word;
 
-
 class DFAItem
 {
-    private $word = array();
+    private $word = null;
+    private $sub_items = array();
+    private $is_end = 0;
+
+    public function __set($name, $value)
+    {
+        $this->$name = $value;
+    }
+
+    public function __get($name)
+    {
+        return $this->$name;
+    }
+
+    // 初始化
+    public function init($word)
+    {
+        $cnt = count($word);
+        if ($cnt <= 0) {
+            return null;
+        } else if ($cnt === 1) {
+            $this->is_end = 1;
+            $this->word = $word[0];
+            $this->sub_items = null;
+        } else {
+            $this->is_end = 0;
+            $this->word = $word[0];
+            $this->add_item(array_slice($word, 1));
+        }
+        return $this;
+    }
+
+    // 添加子节点内容
+    public function add_item($word)
+    {
+        $subitem = new DFAItem();
+        $ret = $subitem->init($word);
+        if (!is_null($ret)) {
+            array_push($this->sub_items, $subitem);
+        }
+    }
+
+    // 向链表中添加内容
+    public function addwords($word)
+    {
+        $found = false;
+        foreach ($this->sub_items as $item) {
+            if (0 == strcmp($word[0], $item->word)) {
+                $item->addwords(array_slice($word, 1));
+                $found = true;
+            }
+        }
+
+        if (!$found) {
+            $subitem = new DFAItem();
+            $subitem->init($word);
+            array_push($this->sub_items, $subitem);
+        }
+    }
 
+    // 判断关键字是否在属于此item
+    public function checkword($txt)
+    {
+        if (is_null($txt)) {
+            return false;
+        }
+        $head = mb_substr($txt, 0, 1);
+        $found = false;
+        foreach ($this->sub_items as $item) {
 
+            if (0 == strcmp($item->word, $head)) {
+                if ($item->is_end == 1) {
+                    return true;
+                } else {
+                    return $item->checkword(mb_substr($txt, 1));
+                }
+            }
+        }
+        if (!$found) {
+            return false;
+        }
+    }
 }

+ 64 - 0
helper/sensitive/SensitiveWordInit.php

@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * 初始化敏感词库<br>
+ * 将敏感词加入到HashMap中<br>
+ * 构建DFA算法模型
+ *
+ * @author dxm
+ *
+ */
+
+namespace sensitive_word;
+
+require_once(BASE_ROOT_PATH . "/helper/sensitive/DFAItem.php");
+
+class SensitiveWordInit
+{
+    // 字符编码
+    const ENCODING = "UTF-8";
+
+    /**
+     * 初始化敏感字库
+     *
+     * @return
+     */
+    public function initKeyWord()
+    {
+        $word_array = $this->readSensitiveWordFile();
+        return $this->addSensitiveWordToHashMap($word_array);
+    }
+
+    /**
+     * 读取敏感词库,将敏感词放入HashSet中,构建一个DFA算法模型:<br>
+     * 中 = { isEnd = 0 国 = {<br>
+     * isEnd = 1 人 = {isEnd = 0 民 = {isEnd = 1} } 男 = { isEnd = 0 人 = { isEnd =
+     * 1 } } } } 五 = { isEnd = 0 星 = { isEnd = 0 红 = { isEnd = 0 旗 = { isEnd = 1
+     * } } } }
+     *
+     */
+    public function addSensitiveWordToHashMap($words)
+    {
+        $dfa = new DFAItem();
+        foreach ($words as $word) {
+            $dfa->addwords(explode(" ",$word));
+        }
+        return $dfa;
+    }
+
+    /**
+     * 读取敏感词库中的内容,将内容添加到array中
+     *
+     * @return
+     * @throws Exception
+     */
+    private function readSensitiveWordFile()
+    {
+        $word_array = array();
+        array_push($word_array, '中 国');
+        array_push($word_array, '中 央');
+        array_push($word_array, '国 家');
+        array_push($word_array, '他 妈 的');
+        return $word_array;
+    }
+}

+ 112 - 0
helper/sensitive/SensitivewordFilter.php

@@ -0,0 +1,112 @@
+<?php
+
+/**
+ * 敏感词过滤
+ *
+ * @author dxm
+ *
+ */
+
+namespace sensitive_word;
+
+require_once(BASE_ROOT_PATH . "/helper/sensitive/DFAItem.php");
+
+class SensitivewordFilter
+{
+
+    private $dfa = null;
+
+    // 最小匹配规则
+    public static $minMatchTYpe = 1;
+
+    // 最大匹配规则
+    public static $maxMatchType = 2;
+
+    // 单例
+    private static $inst = null;
+
+    /**
+     * 构造函数,初始化敏感词库
+     */
+    function __construct()
+    {
+    }
+
+
+    /**
+     * 获取单例
+     *
+     * @return
+     */
+    public static function getInstance()
+    {
+        if (null == self::$inst) {
+            self::$inst = new SensitivewordFilter();
+            self::$inst->dfa = (new \sensitive_word\SensitiveWordInit())->initKeyWord();
+        }
+        return self::$inst;
+    }
+
+    /**
+     * 判断文字是否包含敏感字符
+     *
+     * @param txt
+     * @param matchType
+     * @return
+     */
+    public function isContaintSensitiveWord($txt)
+    {
+        return $this->dfa->checkword($txt);
+    }
+
+    /**
+     * 获取文字中的敏感词
+     *
+     * @param txt
+     * @param matchType
+     * @return
+     */
+    public function getSensitiveWord($txt, $matchType)
+    {
+
+    }
+
+    /**
+     * 替换敏感字字符
+     *
+     * @param txt
+     * @param matchType
+     * @param replaceChar
+     * @return
+     */
+    public function  replaceSensitiveWord($txt, $matchType, $replaceChar)
+    {
+
+    }
+
+    /**
+     * 获取替换字符串
+     *
+     * @param replaceChar
+     * @param length
+     * @return
+     */
+    private function getReplaceChars($replaceChar, $length)
+    {
+    }
+
+    /**
+     * 检查文字中是否包含敏感字符,检查规则如下:<br>
+     * 如果存在,则返回敏感词字符的长度,不存在返回0
+     *
+     * @param txt
+     * @param beginIndex
+     * @param matchType
+     * @return
+     */
+    public function CheckSensitiveWord($txt, $beginIndex, $matchType)
+    {
+
+    }
+
+}

+ 1 - 1
helper/umeng.php

@@ -216,7 +216,7 @@ class upush
     {
 //        $ret = $this->pre_pack();
 //        if ($ret) {
-        
+
             $pack_body = self::android_pack();
             $url = self::PUSH_URL . '?sign=' . self::make_sign("POST", self::PUSH_URL, $pack_body, self::APP_MASTER_SECRET);
             return $this->http_post_data($url, json_encode($pack_body));

+ 2 - 1
mobile/alipay_notify_url.php

@@ -46,7 +46,8 @@ if ($verify_result)
                 Log::record("update_order success: pay_sn={$pay_sn}", Log::DEBUG);
                 echo('success');
             }
-        }
+
+         }
     }
     else if ($trade_status == 'WAIT_BUYER_PAY') {
 

+ 3 - 3
mobile/control/brand.php

@@ -25,9 +25,9 @@ class brandControl extends mobileHomeControl
         $brands = array();
         foreach ($brand_area_list as $brand_area) {
             foreach ($brand_c_list as $brand) {
-                $brand['brand_pic'] = func::format_brand_img_rect($brand['brand_pic']);
-                $brand['brand_img_bg'] = func::format_brand_img_bg($brand['brand_img_bg']);
-                $brand['brand_img_logo'] = func::format_brand_img_circle($brand['brand_img_logo']);
+                $brand['brand_pic'] = image_helper::format_brand_img_rect($brand['brand_pic']);
+                $brand['brand_img_bg'] = image_helper::format_brand_img_bg($brand['brand_img_bg']);
+                $brand['brand_img_logo'] = image_helper::format_brand_img_circle($brand['brand_img_logo']);
                 if ($brand['brand_area_id'] == $brand_area['area_id']) {
                     if (empty($brand_area['data'])) {
                         $brand_area['data'] = array();

+ 2 - 2
mobile/control/goods.php

@@ -225,8 +225,8 @@ class goodsControl extends mobileControl
         if (!empty(trim($_GET['brand_id']))) {
             $brand = Model()->table("brand")->find(intval($_GET['brand_id']));
             if (!empty($brand)) {
-                $extend['brand_img_logo'] = func::format_brand_img($brand['brand_img_logo']);
-                $extend['brand_img_bg'] = func::format_brand_img($brand['brand_img_bg']);
+                $extend['brand_img_logo'] = image_helper::format_brand_img($brand['brand_img_logo']);
+                $extend['brand_img_bg'] = image_helper::format_brand_img($brand['brand_img_bg']);
                 $extend['brand_title'] = $brand['brand_name'];
             }
         }

+ 8 - 12
research/db.php

@@ -1,30 +1,26 @@
 <?php
 
-require_once (BASE_CORE_PATH . '/framework/db/mysql.php');
+require_once (BASE_CORE_PATH . '/framework/db/mysqli.php');
 require_once (BASE_DATA_PATH . '/model/member.model.php');
 
 
 
-Db::connect('master');
+//Db::connect('master');
 
 $cur = new DateTime();
 $start = $cur->getTimestamp();
 
 echo $start; 
 echo "   ";
-for($i = 10000; $i > 0; --$i) {
+for($i = 100; $i > 0; --$i) {
     $openid = uniqid();
     $model_member = Model('member');   
         
-    $userid = $model_member->getMemberID($openid,1);
-    //Db::query("SELECT * FROM `33hao_mb_special_item` WHERE ( special_id = '0' ) AND ( item_usable = '1' ) ORDER BY item_sort asc LIMIT 1000");
-    
-//    $sql = "SELECT member_id FROM 33hao_member WHERE ( member_type = '1' ) AND ( anonymous_id = '";
-//    $sql = $sql . $openid;
-//    $sql = $sql . ') LIMIT 1';
-//    
-//    Db::query($sql);
-    //Db::query("SELECT member_id FROM 33hao_member WHERE ( member_type = '1' ) AND ( anonymous_id = '561f249a55de8099' ) LIMIT 1");
+    $info = $model_member->getMemberInfo(array('member_id' => $openid),'member_mobile');
+
+    if(!empty($info) && count($info) > 0) {
+        echo ($info[0]['member_mobile'] . '\r\n');
+    }
 }
 
 //$data = $model->table('goods')->find(38);

+ 207 - 207
research/research_run.php

@@ -1,217 +1,217 @@
 <?php
 
-//include BASE_ROOT_PATH . "/research/db.php";
+include BASE_ROOT_PATH . "/research/db.php";
 //include BASE_ROOT_PATH . "/research/function_test.php";
 //include BASE_ROOT_PATH . "/research/sms_test.php";
 //include BASE_ROOT_PATH . "/research/wxpay.php";
 
-define('BASE_CORE_PATH',BASE_ROOT_PATH.'/core');
-define('BASE_DATA_PATH',BASE_ROOT_PATH.'/data');
-define('BASE_MOBILE_PATH',BASE_ROOT_PATH.'/mobile');
-define('BASE_CRONTAB_PATH',BASE_ROOT_PATH.'/crontab');
-define('BASE_UPLOAD_PATH',BASE_DATA_PATH.'/upload');
-define('BASE_UTIL_PATH',BASE_ROOT_PATH.'/util');
-
-require_once (BASE_ROOT_PATH . '/helper/text_filter.php');
-require_once (BASE_ROOT_PATH . '/helper/category_helper.php');
-
-
-define('InShopNC',true);
-
-
-$str = <<< EOT
-<script type="text/javascript">
-    function app(){
-        var app=navigator.userAgent.toLowerCase(),//判断设备
-            app_nav=navigator.appVersion.toLowerCase(),
-            href='';
-        if(app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
-            href='https://www.pgyer.com/pfcB';
-        }else if(app.indexOf('micromessenger')>-1&&app_nav.indexOf('android')>-1){
-            href="javascript:void(0)";
-        }
-        else {
-            href='http://a.lrlz.com/data/upgrade/lrlz_release_1.0.8.apk';
-        }
-        return href;
-
-    }
-    function href(){
-        $('#href_link').attr('href',app());
-    }
-    href();
-</script>
-
-    <div class="top">
-        <p class="title">红包详情</p>
-        <div class="logo"></div>
-    </div>
-EOT;
-
-
-$str = text_filter::filter_html($str);
-
-category_helper::instance()->
-
-
-
-
-
-$x = time();
-
-$member_birthday = strftime ("%Y-%m-%d %H:%M:%S",time());
-
-function is_date($time)
-{
-    $pattern = '/[\d]{4}-[\d]{1,2}-[\d]{1,2}/';
-
-    return (preg_match($pattern, $time) == 1);
-}
-
-$x = '';
-$y = isset($x);
-
-if('safdasefasefasf'==0){
-    echo "该字符串转换为数字  等于 0 <br/>";
-}//output:该字符串转换为数字 等于零。
-
-$a='0';
-if($a==''){
-    echo "0  等于  '' <br/>";
-}    //output:0 等于''
-if(trim($a)==''){
-    echo "trim(0)等于'' <br/>";
-}    //no output
-
-if($a===''){
-    echo "0==='' <br/>";
-}    //no output
-if(empty($a)){
-    echo "'' is empty <br/>";
-}   //output:'' is empty
-if(is_null($a)){
-    echo "0 is null <br/>";
-}   //no output
-if(is_numeric($a)){
-    echo "0 is numeric <br/>";
-}   //output:0 is numeric
-if(is_string($a)){
-    echo "0 is string <br/>";
-}   //no output
-if(strval($a)==''){
-    echo "转换成字符串的0 is '' <br/>";
-}   //no output
-//========= 判断 0 和 '' 以及 empty null false的关系 end =========//
-//========= 判断 '' 和 0 以及 empty null false的关系 start =========//
-$b = '';
-if($b==0){
-    echo "''  等于  0 <br/>";
-}    //output:''  等于  0
-if(!''){
-    echo "'' 就是false <br/>";
-}    //output:'' 就是false
-if(!0){
-    echo "0 就是false <br/>";
-}    //output:0 就是false
-//========= 判断 '' 和 0 以及 empty null false的关系 end =========//
-echo "在判断空('')的时候一定要小心,0 也相当于'' ,0  和 '' 都相当于空字符和false,判断为空最好用===";
-
-$x = '1978-02-05';
-$y = is_date($x);
-
-$x = time();
-
-$member_birthday = strftime ("%Y-%m-%d","{$x}");
-
-$time = strtotime($member_birthday);
-
-
-$str = NULL;
-$y = '';
-if(isset($str)) {
-    $x = 0;
-}
-
-if(empty($str)) {
-    $x = 1;
-}
-
-if($str == NULL) {
-    $x = 2;
-}
-
-if(isset($y)) {
-    $x = 0;
-}
-
-if(empty($y)) {
-    $x = 1;
-}
-
-if($y == NULL) {
-    $x = 2;
-}
-
-
-$file = "/mobile/index.php";
-$ops = explode("?",$file);
-
-$squery = $ops[1];
-$params = preg_split('/&|=/', $squery);
-
-for ($i = 0; $i < count($params); ++$i) {
-    $key = $params[$i];
-    $val = $params[++$i];
-    $_GET[$key] = $val;
-    $_POST[$key] = $val;
-}
-
-
-
-
-$ret = array('jsObj' => NULL,'jsArray' => array());
-unset($ret['xxx']);
-$ret = json_encode($ret);
-
-define('BASE_ROOT_PATH',str_replace('\\','/',dirname(__FILE__)));
-
-echo BASE_ROOT_PATH."\n";
-
-require_once (BASE_ROOT_PATH . '/fooder.php');
-
-echo $argv;
-
-function help_out()
-{
-    echo "fetch_goods:start fetch goods.\r\n";
-    echo "fillgcid:start fill all goods class id.\r\n";
-    echo "checkgoods:check all goods class id.\r\n";
-
-}
-
-
-$time = -microtime();
-//$hash = 0;
-//for ($i=0; $i < rand(1000,4000); ++$i) {
-//    $hash ^= md5(substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, rand(1,10)));
+//define('BASE_CORE_PATH',BASE_ROOT_PATH.'/core');
+//define('BASE_DATA_PATH',BASE_ROOT_PATH.'/data');
+//define('BASE_MOBILE_PATH',BASE_ROOT_PATH.'/mobile');
+//define('BASE_CRONTAB_PATH',BASE_ROOT_PATH.'/crontab');
+//define('BASE_UPLOAD_PATH',BASE_DATA_PATH.'/upload');
+//define('BASE_UTIL_PATH',BASE_ROOT_PATH.'/util');
+//
+//require_once (BASE_ROOT_PATH . '/helper/text_filter.php');
+//require_once (BASE_ROOT_PATH . '/helper/category_helper.php');
+//
+//
+//define('InShopNC',true);
+//
+//
+//$str = <<< EOT
+//<script type="text/javascript">
+//    function app(){
+//        var app=navigator.userAgent.toLowerCase(),//判断设备
+//            app_nav=navigator.appVersion.toLowerCase(),
+//            href='';
+//        if(app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
+//            href='https://www.pgyer.com/pfcB';
+//        }else if(app.indexOf('micromessenger')>-1&&app_nav.indexOf('android')>-1){
+//            href="javascript:void(0)";
+//        }
+//        else {
+//            href='http://a.lrlz.com/data/upgrade/lrlz_release_1.0.8.apk';
+//        }
+//        return href;
+//
+//    }
+//    function href(){
+//        $('#href_link').attr('href',app());
+//    }
+//    href();
+//</script>
+//
+//    <div class="top">
+//        <p class="title">红包详情</p>
+//        <div class="logo"></div>
+//    </div>
+//EOT;
+//
+//
+//$str = text_filter::filter_html($str);
+//
+//category_helper::instance()->
+//
+//
+//
+//
+//
+//$x = time();
+//
+//$member_birthday = strftime ("%Y-%m-%d %H:%M:%S",time());
+//
+//function is_date($time)
+//{
+//    $pattern = '/[\d]{4}-[\d]{1,2}-[\d]{1,2}/';
+//
+//    return (preg_match($pattern, $time) == 1);
+//}
+//
+//$x = '';
+//$y = isset($x);
+//
+//if('safdasefasefasf'==0){
+//    echo "该字符串转换为数字  等于 0 <br/>";
+//}//output:该字符串转换为数字 等于零。
+//
+//$a='0';
+//if($a==''){
+//    echo "0  等于  '' <br/>";
+//}    //output:0 等于''
+//if(trim($a)==''){
+//    echo "trim(0)等于'' <br/>";
+//}    //no output
+//
+//if($a===''){
+//    echo "0==='' <br/>";
+//}    //no output
+//if(empty($a)){
+//    echo "'' is empty <br/>";
+//}   //output:'' is empty
+//if(is_null($a)){
+//    echo "0 is null <br/>";
+//}   //no output
+//if(is_numeric($a)){
+//    echo "0 is numeric <br/>";
+//}   //output:0 is numeric
+//if(is_string($a)){
+//    echo "0 is string <br/>";
+//}   //no output
+//if(strval($a)==''){
+//    echo "转换成字符串的0 is '' <br/>";
+//}   //no output
+////========= 判断 0 和 '' 以及 empty null false的关系 end =========//
+////========= 判断 '' 和 0 以及 empty null false的关系 start =========//
+//$b = '';
+//if($b==0){
+//    echo "''  等于  0 <br/>";
+//}    //output:''  等于  0
+//if(!''){
+//    echo "'' 就是false <br/>";
+//}    //output:'' 就是false
+//if(!0){
+//    echo "0 就是false <br/>";
+//}    //output:0 就是false
+////========= 判断 '' 和 0 以及 empty null false的关系 end =========//
+//echo "在判断空('')的时候一定要小心,0 也相当于'' ,0  和 '' 都相当于空字符和false,判断为空最好用===";
+//
+//$x = '1978-02-05';
+//$y = is_date($x);
+//
+//$x = time();
+//
+//$member_birthday = strftime ("%Y-%m-%d","{$x}");
+//
+//$time = strtotime($member_birthday);
+//
+//
+//$str = NULL;
+//$y = '';
+//if(isset($str)) {
+//    $x = 0;
+//}
+//
+//if(empty($str)) {
+//    $x = 1;
+//}
+//
+//if($str == NULL) {
+//    $x = 2;
+//}
+//
+//if(isset($y)) {
+//    $x = 0;
+//}
+//
+//if(empty($y)) {
+//    $x = 1;
+//}
+//
+//if($y == NULL) {
+//    $x = 2;
+//}
+//
+//
+//$file = "/mobile/index.php";
+//$ops = explode("?",$file);
+//
+//$squery = $ops[1];
+//$params = preg_split('/&|=/', $squery);
+//
+//for ($i = 0; $i < count($params); ++$i) {
+//    $key = $params[$i];
+//    $val = $params[++$i];
+//    $_GET[$key] = $val;
+//    $_POST[$key] = $val;
+//}
+//
+//
+//
+//
+//$ret = array('jsObj' => NULL,'jsArray' => array());
+//unset($ret['xxx']);
+//$ret = json_encode($ret);
+//
+//define('BASE_ROOT_PATH',str_replace('\\','/',dirname(__FILE__)));
+//
+//echo BASE_ROOT_PATH."\n";
+//
+//require_once (BASE_ROOT_PATH . '/fooder.php');
+//
+//echo $argv;
+//
+//function help_out()
+//{
+//    echo "fetch_goods:start fetch goods.\r\n";
+//    echo "fillgcid:start fill all goods class id.\r\n";
+//    echo "checkgoods:check all goods class id.\r\n";
+//
+//}
+//
+//
+//$time = -microtime();
+////$hash = 0;
+////for ($i=0; $i < rand(1000,4000); ++$i) {
+////    $hash ^= md5(substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, rand(1,10)));
+////}
+//$time += microtime();
+//$y = sprintf('%f', $time);
+//
+//
+//$y = strtotime('2016-12-12 01:01:01');
+//
+//$y = urldecode('%E4%B8%AD%E9%80%9A%E5%BF%AB%E9%80%92');
+//
+//$x=new date();
+//
+//define('StartTime', microtime(true));
+//define('TIMESTAMP', time());
+//
+//if(count($argv) == 1) {
+//
+//    return;
 //}
-$time += microtime();
-$y = sprintf('%f', $time);
-
-
-$y = strtotime('2016-12-12 01:01:01');
-
-$y = urldecode('%E4%B8%AD%E9%80%9A%E5%BF%AB%E9%80%92');
-
-$x=new date();
-
-define('StartTime', microtime(true));
-define('TIMESTAMP', time());
-
-if(count($argv) == 1) {
-
-    return;
-}
 
 
 

+ 3 - 0
run.php

@@ -3,6 +3,8 @@
 
 define('BASE_ROOT_PATH',str_replace('\\','/',dirname(__FILE__)));
 
+require_once(BASE_ROOT_PATH . '/fooder.php');
+
 $gfcgi_run = 1;
 
 if($gfcgi_run == 0) { //模拟请求
@@ -12,6 +14,7 @@ if($gfcgi_run == 0) { //模拟请求
     Base::mobile_control();
 } elseif ($gfcgi_run == 1) {
     $file = BASE_ROOT_PATH . '/research/research_run.php';
+    Base::run_util();
     include $file;
 } else {
     Base::run_util();