init();
}
public function testHot()
{
$dict = new search\category_dict();
}
public function testBrand()
{
$dict = new search\brand_dict();
}
public function testSearcher()
{
$searcher = new search\searcher();
$searcher->init();
for($i = 0; $i < 10; ++$i) {
$result = $searcher->get_result(array('keyword' => '', 'brand_id' => 0,'hot_id' => 11,'order' => 'price', 'sort' => 'desc', 'page_no' => 1, 'page_size' => 10));
$result = $searcher->get_word('茱莉');
}
}
public function testArea()
{
$result = search\search_client::instance()->get_area(37);
}
public function testRequest()
{
$result = search\search_client::instance()->get_result(['keyword' => 'bb']);
}
public function testBrandSpecia()
{
$brands = new brands_special();
$ret = $brands->info(4);
}
public function testGoods()
{
$mod = Model('goods');
$items = $mod->getGoodsOnlineList(array(), "*", '', '', false);
$mod_common = Model("goods_common");
$items = $mod->field("*")->limit(false)->select();
}
public function testUasort()
{
$words = [];
$words[] = array("add_time" => 104,"count" => 1);
$words[] = array("add_time" => 100,"count" => 1);
$words[] = array("add_time" => 300,"count" => 1);
$ret = uasort($words,'comp_time');
foreach ($words as $key => $val) {
echo $key;
}
}
public function testHotsearch()
{
$x = @explode(',',C('hot_search'));//热门搜索
$goodslist = Model('goods_browse')->getGuessLikeGoods(36490,10);
}
public function testUnion()
{
$a1 = array(1,3,5,7,9);
$a2 = array(1,2,3,5,8,9);
$result = algorithm::set_union($a1,$a2);
}
public function testUnionx()
{
$x = '满500减50 送[赠品]';
$y = stripslashes($x);
preg_match('#(.*?).*?#s',$x,$matches);
$host = $matches[2];
}
public function testParams()
{
$params = array("xxx" => 1);
$params = json_encode($params);
$data = array('action' => 'groupbuy','params' => array('pay_sn' => 'fdfdsafdas'));
$data = json_encode($data);
}
public function testNull()
{
$x = 'a:1:{s:4:"item";a:6:{s:25:"s61_05308797997352196.png";a:3:{s:5:"image";s:25:"s61_05308797997352196.png";s:4:"type";s:7:"special";s:4:"data";s:2:"53";}s:25:"s61_05308798368461066.png";a:3:{s:5:"image";s:25:"s61_05308798368461066.png";s:4:"type";s:7:"special";s:4:"data";s:2:"49";}s:25:"s61_05308798643188523.png";a:3:{s:5:"image";s:25:"s61_05308798643188523.png";s:4:"type";s:7:"special";s:4:"data";s:2:"50";}s:25:"s61_05308798882646585.png";a:3:{s:5:"image";s:25:"s61_05308798882646585.png";s:4:"type";s:7:"special";s:4:"data";s:2:"51";}s:25:"s61_05308799439510460.png";a:3:{s:5:"image";s:25:"s61_05308799439510460.png";s:4:"type";s:7:"special";s:4:"data";s:2:"46";}s:25:"s61_05308799642656955.png";a:3:{s:5:"image";s:25:"s61_05308799642656955.png";s:4:"type";s:7:"special";s:4:"data";s:2:"47";}}}';
$y = unserialize($x);
}
public function testDefine()
{
$i = 0;
while ( $i < 5) {
sleep(1);
echo "{i} " . TIME_STAMP . "\n";
++$i;
}
}
public function testNotin()
{
$x = array(1,3,4,9,8,5);
$y = array(3,2,3,4,9,8);
$z = algorithm::not_in($x,$y);
}
public function testPasswd()
{
$x = md5('panda@qaz@makeup');
$y = md5('xmmz@20161104');
}
public function testTime()
{
list($usec, $sec) = explode(" ", microtime());
$t = time();
$x = intval(microtime(true) * 10000);
$y = intval(microtime(true) * 10000);
$k = $y - $x;
$z = microtime(true);
$w = microtime(true);
echo ($y - $x);
}
public function testPing()
{
$val = '🐳🐳🐳²₀¹₇';
$info['alpha'] = Pinyin::getAlpha($val);
}
}