Forráskód Böngészése

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

liax 9 éve
szülő
commit
0f308da835
55 módosított fájl, 364 hozzáadás és 44 törlés
  1. 26 0
      crontab/control/testpush.php
  2. 38 9
      data/logic/queue.logic.php
  3. 5 1
      data/model/mb_special.model.php
  4. BIN
      data/resource/mobile/category/bbs.png
  5. BIN
      data/resource/mobile/category/cg.png
  6. BIN
      data/resource/mobile/category/cz.png
  7. BIN
      data/resource/mobile/category/fb.png
  8. BIN
      data/resource/mobile/category/fdy.png
  9. BIN
      data/resource/mobile/category/fs.png
  10. BIN
      data/resource/mobile/category/grhl.png
  11. BIN
      data/resource/mobile/category/hf.png
  12. BIN
      data/resource/mobile/category/hzs.png
  13. BIN
      data/resource/mobile/category/jm.png
  14. BIN
      data/resource/mobile/category/jmg.png
  15. BIN
      data/resource/mobile/category/mb.png
  16. BIN
      data/resource/mobile/category/mbjh.png
  17. BIN
      data/resource/mobile/category/mfhf.png
  18. BIN
      data/resource/mobile/category/mm.png
  19. BIN
      data/resource/mobile/category/myr.png
  20. BIN
      data/resource/mobile/category/nshf.png
  21. BIN
      data/resource/mobile/category/nshl.png
  22. BIN
      data/resource/mobile/category/nsjm.png
  23. BIN
      data/resource/mobile/category/nsrs.png
  24. BIN
      data/resource/mobile/category/nssfs.png
  25. BIN
      data/resource/mobile/category/qjz.png
  26. BIN
      data/resource/mobile/category/ry.png
  27. BIN
      data/resource/mobile/category/sf.png
  28. BIN
      data/resource/mobile/category/sh.png
  29. BIN
      data/resource/mobile/category/sthl.png
  30. BIN
      data/resource/mobile/category/szhl.png
  31. BIN
      data/resource/mobile/category/tfzx.png
  32. BIN
      data/resource/mobile/category/xf.png
  33. BIN
      data/resource/mobile/category/xfs.png
  34. BIN
      data/resource/mobile/category/xz.png
  35. BIN
      data/resource/mobile/category/ys.png
  36. BIN
      data/resource/mobile/category/yx.png
  37. BIN
      data/resource/mobile/category/yy.png
  38. BIN
      data/resource/mobile/category/zhl.png
  39. BIN
      data/resource/mobile/category/zx.png
  40. 43 0
      data/sales/category.xml
  41. 119 0
      helper/category_helper.php
  42. 9 18
      helper/push_app.php
  43. 1 1
      helper/sensitive/DFAItem.php
  44. 9 0
      helper/sms_helper.php
  45. 5 0
      helper/text_filter.php
  46. 20 0
      mobile/control/category.php
  47. 1 1
      mobile/control/index.php
  48. 2 2
      mobile/control/member_address.php
  49. 5 1
      mobile/control/member_bonus.php
  50. 4 0
      mobile/control/member_info.php
  51. 9 3
      mobile/control/member_refund.php
  52. 30 8
      mobile/control/search.php
  53. 13 0
      mobile/framework/function/function.php
  54. 11 0
      request_helper.php
  55. 14 0
      research/research_run.php

+ 26 - 0
crontab/control/testpush.php

@@ -0,0 +1,26 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: zry
+ * Date: 2016/5/9
+ * Time: 12:55
+ */
+defined('InShopNC') or exit('Access Invalid!');
+ini_set('default_socket_timeout', -1);
+
+class testpushControl extends BaseCronControl
+{
+
+    public function indexOp() {
+        if (ob_get_level()) ob_end_clean();
+
+        $param = array(
+            'member_id'=>'36489',
+            'text'     =>'Helloworld',
+            'go_type'  =>'bonus',
+        );
+
+        QueueClient::push('upushSendMsg',$param);
+
+    }
+}

+ 38 - 9
data/logic/queue.logic.php

@@ -10,10 +10,21 @@
  */
 defined('InShopNC') or exit('Access Invalid!');
 
+require_once(BASE_ROOT_PATH . '/helper/push_app.php');
+
 class queueLogic
 {
 
     /**
+     * push app内容跳转类型
+     * @var array
+     */
+    protected $go_type = array(
+                               '',//跳转到app首页
+                               'bonus',//红包页
+                              );
+
+    /**
      * 添加会员积分
      * @param unknown $member_info
      */
@@ -376,26 +387,44 @@ class queueLogic
 
     /**
      * 推送服务
+     * @param $param  array
+     * 共有三个key : member_id , text, go_type
+     * @return bool
      */
     public function upushSendMsg($param)
     {
-        if(!empty($param) || empty($param['member_id']) || empty($param['text'])){
-            Log::record("push info: 数据有误! data:".json_encode($param)."\t".json_encode($_SESSION));
+        if(empty($param) || empty($param['member_id']) || empty($param['text'])){
+            Log::record("push info: 数据有误! param:".json_encode($param)."\t session:".json_encode($_SESSION));
+            return false;
         }
 
+        if(!isset($param['go_type'])){
+            $param['go_type'] = '';
+        }
+
+        if(!in_array($param['go_type'],$this->go_type)){
+            Log::record("push info: go_type参数有误! param:".json_encode($param)."\t session:".json_encode($_SESSION));
+            return false;
+        }
+
+        $push = new push_app();
+
         try{
-            $push = new push_app();
             //androd
             $return = $push->sendAndroidCustomizedcast($param);
-            Log::record("push info: androd  return:".json_encode($return));
+            Log::record("push info: androd\treturn:".json_encode($return)."\t param:".json_encode($param));
+        } catch (Exception $e) {
+            Log::record("push info: androd fall error\treturn:".$e->getMessage()."\t param:".json_encode($param));
+        }
+
+        try{
             //ios
-            $return = $push->sendIOSCustomizedcast($push);
-            Log::record("push info: ios  return:".json_encode($return));
+            $return = $push->sendIOSCustomizedcast($param);
+            Log::record("push info: ios\treturn:".json_encode($return)."\t param:".json_encode($param));
         } catch (Exception $e) {
-            print("Caught exception: " . $e->getMessage());
-            Log::record("push info: fall error return:".$e->getMessage());
+            Log::record("push info: ios fall error\treturn:".$e->getMessage()."\t param:".json_encode($param));
         }
 
-        return;
+        return true;
     }
 }

+ 5 - 1
data/model/mb_special.model.php

@@ -141,15 +141,19 @@ class mb_specialModel extends Model
                     foreach ($item_data['item'] as &$item) {
 
                         $model_goods = Model('goods');
-                        $goods_detail = $model_goods->getGoodsInfo(array('goods_id' => $item['goods_id']), 'goods_price,goods_storage,goods_storage_alarm');
+                        $goods_detail = $model_goods->getGoodsInfo(array('goods_id' => $item['goods_id']), 'goods_price,goods_storage,goods_storage_alarm,goods_jingle,goods_marketprice');
                         if (!empty($goods_detail)) {
                             $item['goods_price'] = $goods_detail['goods_price'];
                             $item['goods_storage'] = $goods_detail['goods_storage'];
                             $item['goods_storage_alarm'] = $goods_detail['goods_storage_alarm'];
+                            $item['goods_jingle'] = $goods_detail['goods_jingle'];
+                            $item['goods_marketprice'] = $goods_detail['goods_marketprice'];
                         } else {
                             $item['goods_price'] = 0.0;
                             $item['goods_storage'] = '0';
                             $item['goods_storage_alarm'] = '0';
+                            $item['goods_jingle'] = '';
+                            $item['goods_marketprice'] = '0.00';
                         }
                     }
                 }

BIN
data/resource/mobile/category/bbs.png


BIN
data/resource/mobile/category/cg.png


BIN
data/resource/mobile/category/cz.png


BIN
data/resource/mobile/category/fb.png


BIN
data/resource/mobile/category/fdy.png


BIN
data/resource/mobile/category/fs.png


BIN
data/resource/mobile/category/grhl.png


BIN
data/resource/mobile/category/hf.png


BIN
data/resource/mobile/category/hzs.png


BIN
data/resource/mobile/category/jm.png


BIN
data/resource/mobile/category/jmg.png


BIN
data/resource/mobile/category/mb.png


BIN
data/resource/mobile/category/mbjh.png


BIN
data/resource/mobile/category/mfhf.png


BIN
data/resource/mobile/category/mm.png


BIN
data/resource/mobile/category/myr.png


BIN
data/resource/mobile/category/nshf.png


BIN
data/resource/mobile/category/nshl.png


BIN
data/resource/mobile/category/nsjm.png


BIN
data/resource/mobile/category/nsrs.png


BIN
data/resource/mobile/category/nssfs.png


BIN
data/resource/mobile/category/qjz.png


BIN
data/resource/mobile/category/ry.png


BIN
data/resource/mobile/category/sf.png


BIN
data/resource/mobile/category/sh.png


BIN
data/resource/mobile/category/sthl.png


BIN
data/resource/mobile/category/szhl.png


BIN
data/resource/mobile/category/tfzx.png


BIN
data/resource/mobile/category/xf.png


BIN
data/resource/mobile/category/xfs.png


BIN
data/resource/mobile/category/xz.png


BIN
data/resource/mobile/category/ys.png


BIN
data/resource/mobile/category/yx.png


BIN
data/resource/mobile/category/yy.png


BIN
data/resource/mobile/category/zhl.png


BIN
data/resource/mobile/category/zx.png


+ 43 - 0
data/sales/category.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+  <item title="护肤" id ="1" cids="" img="hf.png">
+    <subitem title="洁面" id ="10" cids="50011977,50024975,121452027" img="jm.png" />
+    <subitem title="化妆水" id ="11" cids="50011978,50012002,121368014" img="hzs.png" />
+    <subitem title="面部精华" id ="12" cids="50011979,121422013,121456011,121756003,121408040" img="mbjh.png" />
+    <subitem title="乳液/面霜" id ="13" cids="50011980,50011996,121410035" img="ry.png" />
+    <subitem title="眼霜" id ="14" cids="121484013,121472009,121410013,121848006,121408040" img="ys.png" />
+    <subitem title="面膜" id ="15" cids="121474010,121366015,121460030,121468012,121426033,121454014" img="mm.png" />
+    <subitem title="防晒/隔离" id ="16" cids="50011982,121426007,121434025,121458034" img="fs.png" />
+    <subitem title="去角质" id ="17" cids="50011997,121408009,121476007,121472008,121384013" img="qjz.png" />
+  </item>
+  <item title="彩妆" id ="2" cids="" img="cz.png">
+    <subitem title="卸妆" id ="20" cids="50011990" img="xz.png" />
+    <subitem title="BB霜" id ="21" cids="50013794" img="bbs.png" />
+    <subitem title="粉底液" id ="22" cids="50010789" img="fdy.png" />
+    <subitem title="散粉" id ="23" cids="50010792" img="sf.png" />
+    <subitem title="粉饼" id ="24" cids="50010790,50010792" img="fb.png" />
+    <subitem title="腮红" id ="25" cids="50010805" img="sh.png" />
+    <subitem title="遮瑕" id ="26" cids="50010803" img="zx.png" />
+    <subitem title="睫毛膏" id ="27" cids="50010794" img="jmg.png" />
+    <subitem title="眼线" id ="28" cids="50010797" img="yx.png" />
+    <subitem title="眼影" id ="29" cids="50010796" img="yy.png" />
+    <subitem title="眉笔/眉粉" id ="290" cids="50010798" img="mb.png" />
+    <subitem title="唇膏/唇彩" id ="291" cids="50010808,50010801,50010807,121392016,121398029,121416019,121418013,121466011,121448009" img="cg.png" />
+  </item>
+  <item title="个人护理" id ="3" cids="" img="grhl.png">
+    <subitem title="洗发水" id ="30" cids="213202,121476023" img="xfs.png" />
+    <subitem title="美发护发" id ="31" cids="50023282,50016883,50023326,50024999" img="mfhf.png" />
+    <subitem title="头发造型" id ="32" cids="50023293" img="tfzx.png" />
+    <subitem title="身体护理" id ="33" cids="121396013,50011992,50012001,50012000,50012006,121412016,121422012,121478012,121484012" img="sthl.png" />
+    <subitem title="手足护理" id ="34" cids="121452007,121398006,121402008,121424012,121456010,122430002" img="szhl.png" />
+    <subitem title="止汗露" id ="35" cids="121392015,121392036" img="zhl.png" />
+    <subitem title="沐浴乳/露" id ="36" cids="50014259,50014260,121366036" img="myr.png" />
+    <subitem title="香氛" id ="37" cids="50010815" img="xf.png" />
+  </item>
+  <item title="男士护肤" id ="4" cids="121410035" img="nshf.png">
+    <subitem title="男士洁面" id ="40" cids="121452027,121470041" img="nsjm.png" />
+    <subitem title="男士爽肤水" id ="41" cids="121392037" img="nssfs.png" />
+    <subitem title="男士乳霜" id ="42" cids="121410035" img="nsrs.png" />
+    <subitem title="男士护理" id ="43" cids="50022680,121386035,121392036,121398029,121416019,121450036,121482026,121404031" img="nshl.png" />
+  </item>
+</category>

+ 119 - 0
helper/category_helper.php

@@ -0,0 +1,119 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: stanley-king
+ * Date: 16/5/9
+ * Time: 下午9:06
+ */
+
+class category_helper
+{
+    const img_path = '/mobile/category';
+    private $file_name = '';
+    private $mCategories = NULL;
+    private $mCids = NULL;
+
+    static private $stInstance = NULL;
+    static public function instance()
+    {
+        if(self::$stInstance == NULL) {
+            self::$stInstance = new category_helper();
+        }
+        return self::$stInstance;
+    }
+
+    private function __construct()
+    {
+        $this->mCids = array();
+        $this->file_name = BASE_DATA_PATH . '/sales/category.xml';
+        self::load_xml($this->file_name);
+    }
+
+    private function load_xml($file)
+    {
+        $xml = simplexml_load_file($file);
+        if($xml === false) {
+            throw new Exception("无法解析XML文件");
+        }
+
+        $url = RESOURCE_SITE_URL . self::img_path;
+
+        $this->mCategories = array();
+        foreach($xml->children() as $xitem)
+        {
+            $item = array();
+            $attrs = $xitem->attributes();
+
+            $title = $attrs['title']->__toString();
+            $pid = $attrs['id']->__toString();
+            $cids = $attrs['cids']->__toString();
+            $img = $attrs['img']->__toString();
+
+            $item['name'] = $title;
+            $item['hot_id'] = $pid;
+            $item['img'] = $url . '/' . $img;
+
+            $item['subitem'] = array();
+            $this->add_cids($pid,$cids);
+
+            foreach($xitem->children() as $xsubitem) {
+                $subitem = array();
+                $sattrs = $xsubitem->attributes();
+
+                $title = $sattrs['title']->__toString();
+                $sid = $sattrs['id']->__toString();
+                $cids = $sattrs['cids']->__toString();
+                $img = $sattrs['img']->__toString();
+
+                $subitem['name'] = $title;
+                $subitem['hot_id'] = $sid;
+                $subitem['img'] = $url . '/' . $img;
+
+                array_push($item['subitem'],$subitem);
+
+                $this->add_cids($sid,$cids);
+                $this->add_cids($pid,$cids);
+            }
+
+            array_push($this->mCategories,$item);
+        }
+    }
+
+    private function add_cids($id,$cids)
+    {
+        if(!array_key_exists($id,$this->mCids)) {
+            $this->mCids[$id] = array();
+        }
+        $cids = explode(',',$cids);
+        foreach($cids as $val)
+        {
+            $cur_cids = &$this->mCids[$id];
+            if(!empty($val) && !in_array($val,$cur_cids)) {
+                array_push($cur_cids,$val);
+            }
+        }
+    }
+
+    public function categories()
+    {
+        try {
+            return $this->mCategories;
+        } catch (Exception $ex) {
+            return array();
+        }
+    }
+
+    public function cids($id)
+    {
+        try
+        {
+            if(!array_key_exists($id,$this->mCids)) {
+                return array();
+            } else {
+                return $this->mCids[$id];
+            }
+        } catch (Exception $ex) {
+            return array();
+        }
+    }
+}

+ 9 - 18
helper/push_app.php

@@ -20,14 +20,7 @@ class push_app
         $this->timestamp = strval(time());
     }
 
-    public function setAliasType($value)
-    {
-        if (!empty($value)) {
-            $this->alias_type = $value;
-        }
-    }
-
-    function sendAndroidCustomizedcast(array $pushinfo)
+    public function sendAndroidCustomizedcast(array $pushinfo)
     {
         $customizedcast = new AndroidCustomizedcast();
         $customizedcast->setAppMasterSecret($this->androd_appmastersecret);
@@ -43,13 +36,15 @@ class push_app
         $customizedcast->setPredefinedKeyValue("title", $pushinfo['text']);
         $customizedcast->setPredefinedKeyValue("text", $pushinfo['text']);
         $customizedcast->setPredefinedKeyValue("after_open", "go_app");
+        //Set extra fields
+        $customizedcast->setExtraField("go_type", $pushinfo['go_type']);
+
         return $customizedcast->send();
     }
 
 
-    function sendIOSCustomizedcast(array $pushinfo)
+    public function sendIOSCustomizedcast(array $pushinfo)
     {
-        try {
             $customizedcast = new IOSCustomizedcast();
             $customizedcast->setAppMasterSecret($this->ios_appmastersecret);
             $customizedcast->setPredefinedKeyValue("appkey", $this->ios_appkey);
@@ -66,13 +61,9 @@ class push_app
             $customizedcast->setPredefinedKeyValue("sound", "chime");
             // Set 'production_mode' to 'true' if your app is under production mode
             $customizedcast->setPredefinedKeyValue("production_mode", "false");
+            //Set extra fields
+            $customizedcast->setCustomizedField("go_type", $pushinfo['go_type']);
+
             return $customizedcast->send();
-        } catch (Exception $e) {
-            print("Caught exception: " . $e->getMessage());
-        }
     }
-}
-
-// Set your appkey and master secret here
-$demo = new push_app();
-$demo->sendIOSCustomizedcast(array('member_id' => '36485', 'text' => 'ddddddddd'));
+}

+ 1 - 1
helper/sensitive/DFAItem.php

@@ -12,6 +12,6 @@ namespace sensitive_word;
 class DFAItem
 {
     private $word = array();
-    
+
 
 }

+ 9 - 0
helper/sms_helper.php

@@ -101,6 +101,15 @@ class sms_helper
             $msg = sprintf("%s,超过当天发送上限.",$stype);
             return $msg;
         }
+        else if($iCode == 160042) {
+            return "号码格式不正确.";
+        }
+        else if($iCode == 160000) {
+            return "第三方短信系统错误.";
+        }
+        else if($iCode == 160034) {
+            return "号码在第三方短信系统黑名单中.";
+        }
         else {
             return "发送短信错误 error={$status}.";
         }

+ 5 - 0
helper/text_filter.php

@@ -21,4 +21,9 @@ class text_filter
 
         return $input;
     }
+    static public function filter_input($input)
+    {
+        $input = self::filter_html($input);
+        return $input;
+    }
 }

+ 20 - 0
mobile/control/category.php

@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Created by PhpStorm.
+ * User: stanley-king
+ * Date: 16/5/9
+ * Time: 下午9:05
+ */
+defined('InShopNC') or exit('Access Invalid!');
+
+require_once(BASE_ROOT_PATH . '/helper/category_helper.php');
+
+class categoryControl extends mobileControl
+{
+    public function indexOp()
+    {
+        $cats = category_helper::instance()->categories();
+        return self::outsuccess(array('items' => $cats));
+    }
+}

+ 1 - 1
mobile/control/index.php

@@ -220,7 +220,7 @@ class indexControl extends mobileHomeControl
 
         //所需字段
         $fieldstr = 'goods_id,goods_commonid,store_id,brand_id,gc_id,goods_name,goods_price,goods_marketprice,goods_promotion_price,
-        goods_image,goods_salenum,evaluation_good_star,evaluation_count,goods_storage,goods_storage_alarm,is_virtual,is_presell,is_fcode,have_gift,goods_mobile_name';
+        goods_image,goods_salenum,evaluation_good_star,evaluation_count,goods_storage,goods_storage_alarm,is_virtual,is_presell,is_fcode,have_gift,goods_mobile_name,goods_jingle';
 
         $helper = new goods_helper();
         $goods_list = $helper->get_infos($goods_ids,$fieldstr);

+ 2 - 2
mobile/control/member_address.php

@@ -146,7 +146,7 @@ class member_addressControl extends mbMemberControl
             array("input" => $_POST["true_name"], "require" => "true", "message" => '姓名不能为空'),
             array("input" => $_POST["area_info"], "require" => "true", "message" => '地区不能为空'),
             array("input" => $_POST["address"], "require" => "true", "message" => '地址不能为空'),
-            array("input" => $_POST['tel_phone'] . $_POST['mob_phone'], 'require' => 'true', 'message' => '联系方式不能为空')
+            Validate::verify_mobile($_POST['mob_phone'])
         );
         $err = $obj_validate->validate();
         if ($err != '') {
@@ -161,7 +161,7 @@ class member_addressControl extends mbMemberControl
         $data['city_id'] = intval($_POST['city_id']);
         $data['area_info'] = urldecode($_POST['area_info']);
         $data['address'] = urldecode($_POST['address']);
-        $data['tel_phone'] = $_POST['tel_phone'];
+        $data['tel_phone'] = '';
         $data['mob_phone'] = $_POST['mob_phone'];
         return $data;
     }

+ 5 - 1
mobile/control/member_bonus.php

@@ -8,6 +8,7 @@
 
 require_once (BASE_ROOT_PATH . '/helper/bonus_helper.php');
 require_once (BASE_ROOT_PATH . '/helper/user_helper.php');
+require_once (BASE_ROOT_PATH . '/helper/text_filter.php');
 
 
 class member_bonusControl extends mbMemberControl
@@ -31,7 +32,10 @@ class member_bonusControl extends mbMemberControl
         }
         $param['send_type'] = $send_type; // '红包类型,1为随机红包,2为固定额度红包'
         $type_bless = isset($_GET['type_bless']) && !empty($_GET['type_bless']) ? $_GET['type_bless'] : self::def_bless;
-        $param['type_bless'] = urldecode($type_bless);
+        $type_bless = urldecode($type_bless);
+        $type_bless = text_filter::filter_input($type_bless);
+
+        $param['type_bless'] = $type_bless;
 
         $param['total_num'] = intval($_GET['total_num']);
         if($param['total_num'] <= 0) {

+ 4 - 0
mobile/control/member_info.php

@@ -3,6 +3,7 @@
  * 获取用户信息
  ***/
 defined('InShopNC') or exit('Access Invalid!');
+require_once (BASE_ROOT_PATH . '/helper/text_filter.php');
 
 class member_infoControl extends mbMemberControl
 {
@@ -60,12 +61,15 @@ class member_infoControl extends mbMemberControl
         }
 
         if(isset($member_nickname)) {
+            $member_nickname = text_filter::filter_input($member_nickname);
             $update['member_nickname'] = $member_nickname;
         }
         if(isset($member_truename)) {
+            $member_truename = text_filter::filter_input($member_truename);
             $update['member_truename'] = $member_truename;
         }
         if(isset($member_signname)) {
+            $member_signname = text_filter::filter_input($member_signname);
             $update['member_signname'] = $member_signname;
         }
         if(isset($member_birthday))

+ 9 - 3
mobile/control/member_refund.php

@@ -67,7 +67,7 @@ class member_refundControl extends mbMemberControl
         $refund_array['reason_info'] = '取消订单,全部退款';
         $refund_array['goods_name'] = '订单商品全部退款';
         $refund_array['refund_amount'] = ncPriceFormat($order_amount);
-        $refund_array['buyer_message'] = $_POST['buyer_message'];
+        $refund_array['buyer_message'] = remove_tags(urldecode($_POST['buyer_message']));
         $refund_array['add_time'] = time();
 
         $pic_array = array();
@@ -163,7 +163,7 @@ class member_refundControl extends mbMemberControl
         if ($order_id < 1 || $order_goods_id < 1) {       //参数验证
             return self::outerr(errcode::ErrParamter, "商品参数错误.");
         }
-        $buyer_msg = isset($_GET['buyer_msg']) ? $_GET['buyer_msg'] : '';
+        $buyer_msg = isset($_GET['buyer_message']) ? remove_tags(urldecode($_GET['buyer_message'])) : '';
 
         $model_refund = Model('refund_return');
 
@@ -262,8 +262,14 @@ class member_refundControl extends mbMemberControl
         $condition = array();
         $condition['buyer_id'] = $_SESSION['member_id'];
         $condition['refund_id'] = intval($_GET['refund_id']);
+        $condition['seller_state'] = array('lt', '3'); //状态:1为待审核,2为同意,3为不同意
         $refund_fields = 'refund_id,order_id,order_sn,order_goods_id,add_time,refund_type,return_type,seller_time,ship_time,admin_time';
         $refund_list = $model_refund->getRefundReturnList($condition, '', $refund_fields);
+
+        if (empty($refund_list)) {
+            return self::outerr(errcode::ErrOrderState);
+        }
+
         $refund = $refund_list[0];
         $refund['refund_state'] = $model_refund->getRefundStatueApp($refund);
 
@@ -298,7 +304,7 @@ class member_refundControl extends mbMemberControl
         $refund_array['ship_time'] = time();
         $refund_array['delay_time'] = time();
       //  $refund_array['express_id'] = $_POST['express_id'];
-        $refund_array['invoice_no'] = $_POST['invoice_no'];
+        $refund_array['invoice_no'] = remove_tags(urldecode($_POST['invoice_no']));
         $refund_array['goods_state'] = '2';
         $state = $model_refund->editRefundReturn($condition, $refund_array);
         if ($state) {

+ 30 - 8
mobile/control/search.php

@@ -3,6 +3,9 @@
 
 defined('InShopNC') or exit('Access Invalid!');
 
+require_once (BASE_ROOT_PATH . '/helper/category_helper.php');
+require_once (BASE_ROOT_PATH . '/helper/goods_helper.php');
+
 class searchControl extends mobileHomeControl
 {
     public function __construct()
@@ -31,7 +34,9 @@ class searchControl extends mobileHomeControl
         initpage($page,$curpage);
 
         $model_goods = Model('goods');
+
         $condition = array();
+        //原有分类查询
         if (!empty(trim($_GET['gc_id']))) {
             $condition['gc_id'] = intval($_GET['gc_id']);
         }
@@ -48,11 +53,20 @@ class searchControl extends mobileHomeControl
             $condition['efficacy_id'] = intval($_GET['efficacy_id']);
         }
 
-        //所需字段
-        $fieldstr = "goods_id,goods_commonid,store_id,brand_id,gc_id,goods_name,goods_price,goods_marketprice,goods_image,goods_salenum,evaluation_good_star,evaluation_count,goods_storage,goods_storage_alarm";
+        if (!empty(trim($_GET['hot_id']))) {
+            $id = intval($_GET['hot_id']);
+            $cids = category_helper::instance()->cids($id);
+            $condition['gc_id'] =  array('in', $cids);
+        }
+
+//        //所需字段
+//        $fieldstr = "goods_id,goods_commonid,store_id,brand_id,gc_id,goods_name,goods_price,goods_marketprice,goods_image,goods_salenum,evaluation_good_star,evaluation_count,goods_storage,goods_storage_alarm";
+//        // 添加3个状态字段
+//        $fieldstr .= ',is_virtual,is_presell,is_fcode,have_gift';
 
-        // 添加3个状态字段
-        $fieldstr .= ',is_virtual,is_presell,is_fcode,have_gift';
+        $fieldstr = 'goods_id,goods_commonid,store_id,brand_id,gc_id,goods_name,goods_price,goods_marketprice,goods_promotion_price,goods_jingle,
+                  goods_image,goods_salenum,evaluation_good_star,evaluation_count,goods_storage,goods_storage_alarm,is_virtual,is_presell,
+                  is_fcode,have_gift,goods_mobile_name';
 
         //排序方式
         $order = $this->_goods_list_order($_GET['key'], $_GET['order']);
@@ -73,14 +87,22 @@ class searchControl extends mobileHomeControl
 //          $goods_list = $model_goods->getGoodsListByColorDistinct($condition, $fieldstr, $order, $this->page);
 //        }
 
-        $goods_list = $model_goods->getGoodsListByColorDistinct($condition, $fieldstr, $order, $this->page);
+        $goods_list = $model_goods->getGoodsListByColorDistinct($condition, 'goods_id', $order, $this->page);
         $page_count = $model_goods->gettotalpage();
         $model_goods->cls();
 
-        //处理商品列表(抢购、限时折扣、商品图片)
-        $goods_list = $this->_goods_list_extend($goods_list);
+        $goods_ids = array();
+        foreach($goods_list as $val) {
+            array_push($goods_ids,$val['goods_id']);
+        }
+
+        $helper = new goods_helper();
+        $goods_list = $helper->get_infos($goods_ids,$fieldstr);
 
-        joutput_data(array('goods_list' => $goods_list, 'mobile_page' => mobile_page($page_count)));
+//        //处理商品列表(抢购、限时折扣、商品图片)
+//        $goods_list = $this->_goods_list_extend($goods_list);
+//
+        self::outsuccess(array('goods_list' => $goods_list, 'mobile_page' => mobile_page($page_count)));
     }
 
     /**

+ 13 - 0
mobile/framework/function/function.php

@@ -89,3 +89,16 @@ function mobile_page($page_count)
     return $extend_data;
 }
 
+/**
+ * 过滤html标签,js代码,css样式标签
+ * @param $str
+ * @return mixed
+ */
+function remove_tags($str) {
+    $str = preg_replace( "@<script(.*?)</script>@is", "", $str );
+    $str = preg_replace( "@<iframe(.*?)</iframe>@is", "", $str );
+    $str = preg_replace( "@<style(.*?)</style>@is", "", $str );
+    $str = preg_replace( "@<(.*?)>@is", "", $str );
+
+    return $str;
+}

+ 11 - 0
request_helper.php

@@ -250,12 +250,23 @@ class request_helper
             }
         }
     }
+
+    /**
+     * 302  跳转
+     */
+    static public function url_jump(){
+        Log::record("server:" . json_encode($_SERVER));
+        if ($_SERVER['HTTP_CLIENT_TYPE'] == 'Android' && $_SERVER['HTTP_CLIENT_VERSION'] == 3) {
+             http_header::instance()->header('location:http://a.lrlz.com:8000'.request_helper::req_uri(),false,302);
+        }
+   }
 }
 
 function init_request()
 {
     request_helper::fill_server();
     request_helper::fill_param();
+    request_helper::url_jump();
 }
 
 class local_request

+ 14 - 0
research/research_run.php

@@ -5,7 +5,16 @@
 //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);
 
@@ -42,6 +51,11 @@ EOT;
 
 $str = text_filter::filter_html($str);
 
+category_helper::instance()->
+
+
+
+
 
 $x = time();