stanley-king 9 år sedan
förälder
incheckning
291bd8a2a3
3 ändrade filer med 218 tillägg och 219 borttagningar
  1. 8 12
      research/db.php
  2. 207 207
      research/research_run.php
  3. 3 0
      run.php

+ 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();