rambo преди 1 година
родител
ревизия
ac514707da
променени са 100 файла, в които са добавени 1918 реда и са изтрити 1634 реда
  1. 3 3
      app/admin/controller/Article.php
  2. 3 3
      app/admin/controller/Bonus.php
  3. 3 3
      app/admin/controller/Evaluate.php
  4. 3 3
      app/admin/controller/Exppoints.php
  5. 33 24
      app/admin/controller/Express.php
  6. 3 3
      app/admin/controller/Feedback.php
  7. 3 3
      app/admin/controller/Flea.php
  8. 3 3
      app/admin/controller/Fleaclass.php
  9. 3 3
      app/admin/controller/Fleaclassindex.php
  10. 3 3
      app/admin/controller/Flearegion.php
  11. 3 3
      app/admin/controller/Fleaseo.php
  12. 46 36
      app/admin/controller/Goods.php
  13. 37 30
      app/admin/controller/Goodsalbum.php
  14. 51 39
      app/admin/controller/Goodsclass.php
  15. 21 16
      app/admin/controller/Goodsvideo.php
  16. 3 3
      app/admin/controller/Groupbuy.php
  17. 3 3
      app/admin/controller/Inform.php
  18. 32 25
      app/admin/controller/InstantMessage.php
  19. 3 3
      app/admin/controller/Inviter.php
  20. 3 3
      app/admin/controller/Link.php
  21. 64 59
      app/admin/controller/LiveApply.php
  22. 3 3
      app/admin/controller/LiveGoods.php
  23. 13 9
      app/admin/controller/LiveSetting.php
  24. 3 3
      app/admin/controller/Mallconsult.php
  25. 3 3
      app/admin/controller/Mallvouchertemplate.php
  26. 3 3
      app/admin/controller/Marketmanage.php
  27. 57 49
      app/admin/controller/Member.php
  28. 52 46
      app/admin/controller/MemberAuth.php
  29. 3 3
      app/admin/controller/Membergrade.php
  30. 123 92
      app/admin/controller/Message.php
  31. 3 3
      app/admin/controller/Navigation.php
  32. 3 3
      app/admin/controller/Notice.php
  33. 3 3
      app/admin/controller/Offpayarea.php
  34. 3 3
      app/admin/controller/Operation.php
  35. 3 3
      app/admin/controller/Order.php
  36. 3 3
      app/admin/controller/Ownshop.php
  37. 18 12
      app/admin/controller/Payment.php
  38. 3 3
      app/admin/controller/Pointorder.php
  39. 3 3
      app/admin/controller/Pointprod.php
  40. 3 3
      app/admin/controller/Points.php
  41. 138 116
      app/admin/controller/Predeposit.php
  42. 3 3
      app/admin/controller/Promotionbargain.php
  43. 3 3
      app/admin/controller/Promotionbooth.php
  44. 3 3
      app/admin/controller/Promotionbundling.php
  45. 3 3
      app/admin/controller/Promotionmansong.php
  46. 3 3
      app/admin/controller/Promotionmgdiscount.php
  47. 3 3
      app/admin/controller/Promotionpintuan.php
  48. 3 3
      app/admin/controller/Promotionpresell.php
  49. 3 3
      app/admin/controller/Promotionwholesale.php
  50. 3 3
      app/admin/controller/Promotionxianshi.php
  51. 3 3
      app/admin/controller/Rechargecard.php
  52. 60 61
      app/admin/controller/Refund.php
  53. 3 3
      app/admin/controller/Region.php
  54. 67 57
      app/admin/controller/Returnmanage.php
  55. 15 11
      app/admin/controller/Seo.php
  56. 3 3
      app/admin/controller/Snsmalbum.php
  57. 3 3
      app/admin/controller/Snsmember.php
  58. 38 30
      app/admin/controller/Spec.php
  59. 3 3
      app/admin/controller/Stataftersale.php
  60. 3 3
      app/admin/controller/Statgeneral.php
  61. 3 3
      app/admin/controller/Statgoods.php
  62. 3 3
      app/admin/controller/Statindustry.php
  63. 3 3
      app/admin/controller/Statmarketing.php
  64. 3 3
      app/admin/controller/Statmember.php
  65. 3 3
      app/admin/controller/Statstore.php
  66. 3 3
      app/admin/controller/Stattrade.php
  67. 120 88
      app/admin/controller/Store.php
  68. 34 26
      app/admin/controller/Storeclass.php
  69. 104 93
      app/admin/controller/Storedeposit.php
  70. 38 28
      app/admin/controller/Storegrade.php
  71. 3 3
      app/admin/controller/Storehelp.php
  72. 3 3
      app/admin/controller/Storejoin.php
  73. 88 77
      app/admin/controller/Storemoney.php
  74. 50 42
      app/admin/controller/Storesnstrace.php
  75. 121 107
      app/admin/controller/Type.php
  76. 13 9
      app/admin/controller/Upload.php
  77. 3 3
      app/admin/controller/Voucher.php
  78. 3 3
      app/admin/controller/Vrgroupbuy.php
  79. 3 3
      app/admin/controller/Vrorder.php
  80. 3 3
      app/admin/controller/Vrrefund.php
  81. 3 3
      app/admin/controller/Webscan.php
  82. 3 3
      app/admin/controller/Wechat.php
  83. 3 3
      app/api/controller/Article.php
  84. 3 3
      app/api/controller/Articleclass.php
  85. 3 3
      app/api/controller/Bargain.php
  86. 3 3
      app/api/controller/Brand.php
  87. 3 3
      app/api/controller/Chain.php
  88. 3 3
      app/api/controller/Connectqq.php
  89. 3 3
      app/api/controller/Connectsina.php
  90. 3 3
      app/api/controller/Document.php
  91. 3 3
      app/api/controller/Groupbuy.php
  92. 183 172
      app/api/controller/Index.php
  93. 3 3
      app/api/controller/Inviterpro.php
  94. 31 28
      app/api/controller/Live.php
  95. 3 3
      app/api/controller/Logout.php
  96. 3 3
      app/api/controller/Marketmanage.php
  97. 32 20
      app/api/controller/Member.php
  98. 3 3
      app/api/controller/MemberArrivalnotice.php
  99. 3 3
      app/api/controller/MemberBargain.php
  100. 26 19
      app/api/controller/MemberInstantMessage.php

+ 3 - 3
app/admin/controller/Article.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Article extends AdminControl

+ 3 - 3
app/admin/controller/Bonus.php

@@ -7,13 +7,13 @@ use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 平台红包 控制器
  */
 class Bonus extends AdminControl

+ 3 - 3
app/admin/controller/Evaluate.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Evaluate extends AdminControl

+ 3 - 3
app/admin/controller/Exppoints.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  *  经验值管理 控制器
  */
 class Exppoints extends AdminControl

+ 33 - 24
app/admin/controller/Express.php

@@ -1,38 +1,42 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Express extends AdminControl {
+class Express extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
         Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/express.lang.php');
     }
 
-    public function index() {
+    public function index()
+    {
         $express_letter = input('get.express_letter');
         $condition = array();
         if (preg_match('/^[A-Z]$/', $express_letter)) {
-            $condition[]=array('express_letter','=',$express_letter);
+            $condition[] = array('express_letter', '=', $express_letter);
         }
-        
+
         $express_name = input('get.express_name');
-        if(!empty($express_name)){
-            $condition[]=array('express_name','like', "%" . $express_name . "%");
+        if (!empty($express_name)) {
+            $condition[] = array('express_name', 'like', "%" . $express_name . "%");
         }
-        
+
         $express_model = model('express');
         $express_list = $express_model->getAllExpresslist($condition, 10);
         View::assign('show_page', $express_model->page_info->render());
@@ -44,7 +48,8 @@ class Express extends AdminControl {
     /**
      * 添加品牌
      */
-    public function add() {
+    public function add()
+    {
         $express_mod = model('express');
         if (request()->isPost()) {
             $insert_array['express_name'] = trim(input('post.express_name'));
@@ -71,12 +76,13 @@ class Express extends AdminControl {
         }
     }
 
-    public function edit() {
+    public function edit()
+    {
         $express_model = model('express');
         $express_id = input('param.express_id');
         $condition = array();
         if (request()->isPost()) {
-            $condition[] = array('express_id','=',$express_id);
+            $condition[] = array('express_id', '=', $express_id);
 
             $data['express_name'] = trim(input('post.express_name'));
             $data['express_code'] = input('post.express_code');
@@ -94,7 +100,7 @@ class Express extends AdminControl {
                 $this->error(lang('ds_common_save_fail'));
             }
         } else {
-            $condition[] = array('express_id','=',$express_id);
+            $condition[] = array('express_id', '=', $express_id);
             $express = $express_model->getOneExpress($condition);
             if (empty($express)) {
                 $this->error(lang('param_error'));
@@ -107,7 +113,8 @@ class Express extends AdminControl {
     /**
      * 删除品牌
      */
-    public function del() {
+    public function del()
+    {
         $express_id = input('param.express_id');
         $express_id_array = ds_delete_param($express_id);
         if ($express_id_array == FALSE) {
@@ -115,7 +122,7 @@ class Express extends AdminControl {
             ds_json_encode(10001, lang('param_error'));
         }
         $express_mod = model('express');
-        $express_mod->delExpress(array(array('express_id','in', implode(',', $express_id_array))));
+        $express_mod->delExpress(array(array('express_id', 'in', implode(',', $express_id_array))));
         $this->log(lang('ds_del') . lang('express') . '[ID:' . $express_id . ']', 1);
         ds_json_encode(10000, lang('ds_common_del_succ'));
     }
@@ -123,7 +130,8 @@ class Express extends AdminControl {
     /**
      * ajax操作
      */
-    public function ajax() {
+    public function ajax()
+    {
         $branch = input('get.branch');
         $column = input('get.column');
         $value = trim(input('get.value'));
@@ -133,7 +141,7 @@ class Express extends AdminControl {
             case 'state':
                 $express_model = model('express');
                 $update_array = array();
-                $condition[] = array('express_id','=',$id);
+                $condition[] = array('express_id', '=', $id);
                 $update_array[$column] = $value;
                 $express_model->editExpress($condition, $update_array);
                 $this->log(lang('ds_edit') . lang('express_name') . lang('ds_state') . '[ID:' . $id . ']', 1);
@@ -143,7 +151,7 @@ class Express extends AdminControl {
             case 'order':
                 $express_model = model('express');
                 $update_array = array();
-                $condition[] = array('express_id','=',$id);
+                $condition[] = array('express_id', '=', $id);
                 $update_array[$column] = $value;
                 $express_model->editExpress($condition, $update_array);
                 $this->log(lang('ds_edit') . lang('express_name') . lang('ds_state') . '[ID:' . $id . ']', 1);
@@ -153,7 +161,8 @@ class Express extends AdminControl {
         }
     }
 
-    public function config(){
+    public function config()
+    {
         $config_model = model('config');
         if (!request()->isPost()) {
             $list_config = rkcache('config', true);
@@ -178,7 +187,8 @@ class Express extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -193,10 +203,9 @@ class Express extends AdminControl {
             array(
                 'name' => 'express_add',
                 'text' => lang('ds_add'),
-                'url' => "javascript:dsLayerOpen('" . (string)url('Express/add') . "','".lang('ds_add')."')"
+                'url' => "javascript:dsLayerOpen('" . (string)url('Express/add') . "','" . lang('ds_add') . "')"
             ),
         );
         return $menu_array;
     }
-
 }

+ 3 - 3
app/admin/controller/Feedback.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Feedback extends AdminControl

+ 3 - 3
app/admin/controller/Flea.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Flea extends AdminControl

+ 3 - 3
app/admin/controller/Fleaclass.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Fleaclass extends AdminControl

+ 3 - 3
app/admin/controller/Fleaclassindex.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Fleaclassindex extends AdminControl

+ 3 - 3
app/admin/controller/Flearegion.php

@@ -7,13 +7,13 @@ use think\facade\Lang;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Flearegion extends AdminControl

+ 3 - 3
app/admin/controller/Fleaseo.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Fleaseo extends AdminControl

+ 46 - 36
app/admin/controller/Goods.php

@@ -5,30 +5,34 @@
  */
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Goods extends AdminControl {
+class Goods extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/goods.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/goods.lang.php');
     }
 
     /**
      * 商品管理
      */
-    public function index() {
+    public function index()
+    {
         $goods_model = model('goods');
         /**
          * 处理商品分类
@@ -44,44 +48,44 @@ class Goods extends AdminControl {
         $where = array();
         $search_goods_name = trim(input('param.search_goods_name'));
         if ($search_goods_name != '') {
-            $where[]=array('goods_name','like', '%' . $search_goods_name . '%');
+            $where[] = array('goods_name', 'like', '%' . $search_goods_name . '%');
         }
         $search_commonid = intval(input('param.search_commonid'));
         if ($search_commonid > 0) {
-            $where[]=array('goods_commonid','=',$search_commonid);
+            $where[] = array('goods_commonid', '=', $search_commonid);
         }
         $search_store_name = trim(input('param.search_store_name'));
         if ($search_store_name != '') {
-            $where[]=array('store_name','like', '%' .$search_store_name . '%');
+            $where[] = array('store_name', 'like', '%' . $search_store_name . '%');
         }
         $b_id = intval(input('param.b_id'));
         if ($b_id > 0) {
-            $where[]=array('brand_id','=',$b_id);
+            $where[] = array('brand_id', '=', $b_id);
         }
         if ($choose_gcid > 0) {
-            $where[] = array('gc_id_' . ($gccache_arr['showclass'][$choose_gcid]['depth']),'=',$choose_gcid);
+            $where[] = array('gc_id_' . ($gccache_arr['showclass'][$choose_gcid]['depth']), '=', $choose_gcid);
         }
 
         $type = input('param.type');
         switch ($type) {
-            // 禁售
+                // 禁售
             case 'lockup':
                 $goods_list = $goods_model->getGoodsCommonLockUpList($where);
                 break;
-            // 等待审核
+                // 等待审核
             case 'waitverify':
                 $goods_list = $goods_model->getGoodsCommonWaitVerifyList($where, '*', 10, 'goods_verify desc, goods_commonid desc');
                 break;
-            // 全部商品
+                // 全部商品
             default:
                 //默认所有商品才有此参数
                 $goods_state = input('param.goods_state');
                 if (in_array($goods_state, array('0', '1', '10'))) {
-                    $where[]=array('goods_state','=',$goods_state);
+                    $where[] = array('goods_state', '=', $goods_state);
                 }
                 $goods_verify = input('param.goods_verify');
                 if (in_array($goods_verify, array('0', '1', '10'))) {
-                    $where[]=array('goods_verify','=',$goods_verify);
+                    $where[] = array('goods_verify', '=', $goods_verify);
                 }
                 $goods_list = $goods_model->getGoodsCommonList($where, '*', 10, 'mall_goods_commend desc,mall_goods_sort asc');
                 break;
@@ -106,10 +110,10 @@ class Goods extends AdminControl {
         View::assign('ownShopIds', array_fill_keys(model('store')->getOwnShopIds(), true));
 
         $type = input('param.type');
-        if(!in_array($type, array('lockup','waitverify','allgoods'))){
+        if (!in_array($type, array('lockup', 'waitverify', 'allgoods'))) {
             $type = 'allgoods';
         }
-        
+
         View::assign('type', $type);
         $this->setAdminCurItem($type);
         return View::fetch();
@@ -119,14 +123,15 @@ class Goods extends AdminControl {
     /**
      * 计算商品库存
      */
-    public function goods_storage($goods_list) {
+    public function goods_storage($goods_list)
+    {
         $goods_model = model('goods');
         // 计算库存
         $storage_array = array();
         if (!empty($goods_list)) {
             foreach ($goods_list as $value) {
-                $storage_array[$value['goods_commonid']]['goods_storage'] = $goods_model->getGoodsSum(array('goods_commonid'=>$value['goods_commonid']),'goods_storage');
-                $storage_array[$value['goods_commonid']][] = $goods_model->getGoodsInfo(array('goods_commonid'=>$value['goods_commonid']),'goods_id');
+                $storage_array[$value['goods_commonid']]['goods_storage'] = $goods_model->getGoodsSum(array('goods_commonid' => $value['goods_commonid']), 'goods_storage');
+                $storage_array[$value['goods_commonid']][] = $goods_model->getGoodsInfo(array('goods_commonid' => $value['goods_commonid']), 'goods_id');
             }
             return $storage_array;
         } else {
@@ -137,19 +142,20 @@ class Goods extends AdminControl {
     /**
      * 违规下架
      */
-    public function goods_lockup() {
+    public function goods_lockup()
+    {
         if (request()->isPost()) {
             $commonids = input('param.commonids');
             $commonid_array = ds_delete_param($commonids);
             if ($commonid_array == FALSE) {
                 $this->error(lang('ds_common_op_fail'));
             }
-            
+
             $update = array();
             $update['goods_stateremark'] = trim(input('post.close_reason'));
 
             $where = array();
-            $where[]=array('goods_commonid','in', $commonid_array);
+            $where[] = array('goods_commonid', 'in', $commonid_array);
 
             model('goods')->editProducesLockUp($update, $where);
             dsLayerOpenSuccess(lang('ds_common_op_succ'));
@@ -162,14 +168,15 @@ class Goods extends AdminControl {
     /**
      * 删除商品
      */
-    public function goods_del() {
+    public function goods_del()
+    {
         $common_id = input('param.common_id');
         $common_id_array = ds_delete_param($common_id);
         if ($common_id_array == FALSE) {
             ds_json_encode('10001', lang('ds_common_op_fail'));
         }
         $condition = array();
-        $condition[]=array('goods_commonid','in',$common_id_array);
+        $condition[] = array('goods_commonid', 'in', $common_id_array);
         model('goods')->delGoodsAll($condition);
         ds_json_encode('10000', lang('ds_common_op_succ'));
     }
@@ -177,7 +184,8 @@ class Goods extends AdminControl {
     /**
      * 审核商品
      */
-    public function goods_verify() {
+    public function goods_verify()
+    {
         if (request()->isPost()) {
             $commonids = input('param.commonids');
             $commonid_array = ds_delete_param($commonids);
@@ -192,7 +200,7 @@ class Goods extends AdminControl {
             $update1['goods_verifyremark'] = trim(input('param.verify_reason'));
             $update1 = array_merge($update1, $update2);
             $where = array();
-            $where[]=array('goods_commonid','in', $commonid_array);
+            $where[] = array('goods_commonid', 'in', $commonid_array);
 
             $goods_model = model('goods');
             if (intval(input('param.verify_state')) == 0) {
@@ -208,14 +216,15 @@ class Goods extends AdminControl {
     }
 
     //ajax获取同一个commonid下面的商品信息
-    public function get_goods_list_ajax() {
+    public function get_goods_list_ajax()
+    {
         $common_id = input('param.commonid');
         if (empty($common_id)) {
             $this->error(lang('param_error'));
         }
         $map['goods_commonid'] = $common_id;
         $goods_model = model('goods');
-        $common_info = $goods_model->getGoodsCommonInfo($map,'spec_name');
+        $common_info = $goods_model->getGoodsCommonInfo($map, 'spec_name');
         $goods_list = $goods_model->getGoodsList($map);
         //halt($goods_list);
         $spec_name = array_values((array) unserialize($common_info['spec_name']));
@@ -231,17 +240,18 @@ class Goods extends AdminControl {
         }
         return json_encode($goods_list);
     }
-    
+
     /**
      * ajax操作
      */
-    public function ajax() {
+    public function ajax()
+    {
         $goods_model = model('goods');
         switch (input('param.branch')) {
             case 'mall_goods_commend':
             case 'mall_goods_sort':
                 if (empty($result)) {
-                    $goods_model->editGoodsCommonById(array(trim(input('param.branch')) => trim(input('param.value'))),array(intval(input('param.id'))));
+                    $goods_model->editGoodsCommonById(array(trim(input('param.branch')) => trim(input('param.value'))), array(intval(input('param.id'))));
                     echo 'true';
                     exit;
                 } else {
@@ -255,7 +265,8 @@ class Goods extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'allgoods',
@@ -275,5 +286,4 @@ class Goods extends AdminControl {
         );
         return $menu_array;
     }
-
 }

+ 37 - 30
app/admin/controller/Goodsalbum.php

@@ -5,59 +5,63 @@
  */
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Goodsalbum extends AdminControl {
+class Goodsalbum extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/goodsalbum.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/goodsalbum.lang.php');
     }
 
     /**
      * 相册列表
      */
-    public function index() {
+    public function index()
+    {
         $condition = array();
         $store_name = '';
         if (is_numeric(input('param.keyword'))) {
             $store_id = intval(input('param.keyword'));
-            $condition[] = array('s.store_id','=',$store_id);
+            $condition[] = array('s.store_id', '=', $store_id);
             $store_name = ds_getvalue_byname('store', 'store_id', $store_id, 'store_name');
         } elseif (!empty(input('param.keyword'))) {
             $store_name = input('param.keyword');
             $store_id = ds_getvalue_byname('store', 'store_name', $store_name, 'store_id');
             if (is_numeric($store_id)) {
-                $condition[] = array('s.store_id','=',$store_id);
+                $condition[] = array('s.store_id', '=', $store_id);
             } else {
-                $condition[] = array('s.store_id','=',0);
+                $condition[] = array('s.store_id', '=', 0);
             }
         }
         $goodsalbum_model = model('album');
-        $albumclass_list = $goodsalbum_model->getGoodsalbumList($condition,10,'a.*,s.store_name');
+        $albumclass_list = $goodsalbum_model->getGoodsalbumList($condition, 10, 'a.*,s.store_name');
         View::assign('show_page', $goodsalbum_model->page_info->render());
 
         if (is_array($albumclass_list) && !empty($albumclass_list)) {
             foreach ($albumclass_list as $v) {
                 $class[] = $v['aclass_id'];
             }
-            $where=array();
-            $where[]=array('aclass_id','in',$class);
+            $where = array();
+            $where[] = array('aclass_id', 'in', $class);
         } else {
             $where = '1=1';
         }
-        $count = $goodsalbum_model->getAlbumpicCountlist($where,'aclass_id,count(*) as pcount','aclass_id');
+        $count = $goodsalbum_model->getAlbumpicCountlist($where, 'aclass_id,count(*) as pcount', 'aclass_id');
 
         $pic_count = array();
         if (is_array($count)) {
@@ -78,26 +82,27 @@ class Goodsalbum extends AdminControl {
     /**
      * 图片列表
      */
-    public function pic_list() {
+    public function pic_list()
+    {
         $condition = array();
         $store_name = '';
         if (is_numeric(input('param.keyword'))) {
             $store_id = intval(input('param.keyword'));
-            $condition[] = array('store_id','=',$store_id);
-            $store_name = ds_getvalue_byname('store','store_id',$store_id,'store_name');
+            $condition[] = array('store_id', '=', $store_id);
+            $store_name = ds_getvalue_byname('store', 'store_id', $store_id, 'store_name');
         } elseif ((input('param.keyword'))) {
             $store_name = input('param.keyword');
-            $store_id = ds_getvalue_byname('store','store_name',$store_name,'store_id');
+            $store_id = ds_getvalue_byname('store', 'store_name', $store_name, 'store_id');
             if (is_numeric($store_id)) {
-                $condition[] = array('store_id','=',$store_id);
+                $condition[] = array('store_id', '=', $store_id);
             } else {
-                $condition[] = array('store_id','=',0);
+                $condition[] = array('store_id', '=', 0);
             }
         } elseif (is_numeric(input('param.aclass_id'))) {
-            $condition[] = array('aclass_id','=',input('param.aclass_id'));
+            $condition[] = array('aclass_id', '=', input('param.aclass_id'));
         }
         $albumpic_model = model('album');
-        $albumpic_list = $albumpic_model->getAlbumpicList($condition,34,'','apic_id desc');
+        $albumpic_list = $albumpic_model->getAlbumpicList($condition, 34, '', 'apic_id desc');
         //halt($albumpic_list);
         $show_page = $albumpic_model->page_info->render();
         View::assign('show_page', $show_page);
@@ -110,14 +115,15 @@ class Goodsalbum extends AdminControl {
     /**
      * 删除相册
      */
-    public function aclass_del() {
+    public function aclass_del()
+    {
         $aclass_id = input('param.aclass_id');
         $aclass_id_array = ds_delete_param($aclass_id);
         if ($aclass_id_array == FALSE) {
             ds_json_encode('10001', lang('param_error'));
         }
-        $condition=array();
-        $condition[]=array('aclass_id','in',$aclass_id_array);
+        $condition = array();
+        $condition[] = array('aclass_id', 'in', $aclass_id_array);
         $albumpic_model = model('album');
         //批量删除相册图片
         $albumpic_model->delAlbumpic($condition);
@@ -130,14 +136,15 @@ class Goodsalbum extends AdminControl {
      * 删除一张图片及其对应记录
      *
      */
-    public function del_album_pic() {
+    public function del_album_pic()
+    {
         $apic_id = input('param.apic_id');
         $apic_id_array = ds_delete_param($apic_id);
         if ($apic_id_array === FALSE) {
             ds_json_encode('10001', lang('param_error'));
         }
-        $condition=array();
-        $condition[]=array('apic_id','in',$apic_id_array);
+        $condition = array();
+        $condition[] = array('apic_id', 'in', $apic_id_array);
         $albumpic_model = model('album');
         //批量删除相册图片
         $albumpic_model->delAlbumpic($condition);
@@ -146,7 +153,8 @@ class Goodsalbum extends AdminControl {
     }
 
 
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -161,5 +169,4 @@ class Goodsalbum extends AdminControl {
         );
         return $menu_array;
     }
-
 }

+ 51 - 39
app/admin/controller/Goodsclass.php

@@ -6,18 +6,20 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Goodsclass extends AdminControl {
+class Goodsclass extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
         Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/goodsclass.lang.php');
     }
@@ -25,7 +27,8 @@ class Goodsclass extends AdminControl {
     /**
      * 分类管理
      */
-    public function goods_class() {
+    public function goods_class()
+    {
         $goodsclass_model = model('goodsclass');
         //父ID
         $parent_id = input('param.gc_parent_id') ? intval(input('param.gc_parent_id')) : 0;
@@ -59,7 +62,8 @@ class Goodsclass extends AdminControl {
     /**
      * 商品分类添加
      */
-    public function goods_class_add() {
+    public function goods_class_add()
+    {
         $goodsclass_model = model('goodsclass');
         if (!request()->isPost()) {
             //父类列表,只取到第二级
@@ -101,7 +105,7 @@ class Goodsclass extends AdminControl {
             $insert_array['commis_rate'] = intval(input('post.commis_rate'));
             $insert_array['gc_sort'] = intval(input('post.gc_sort'));
             $insert_array['gc_virtual'] = intval(input('post.gc_virtual'));
-            if (!empty($_FILES['pic']['name'])) {//上传图片
+            if (!empty($_FILES['pic']['name'])) { //上传图片
                 $res = ds_upload_pic(ATTACH_COMMON, 'pic');
                 if ($res['code']) {
                     $file_name = $res['data']['file_name'];
@@ -129,7 +133,8 @@ class Goodsclass extends AdminControl {
     /**
      * 编辑
      */
-    public function goods_class_edit() {
+    public function goods_class_edit()
+    {
         $goodsclass_model = model('goodsclass');
         $gc_id = intval(input('param.gc_id'));
 
@@ -183,7 +188,7 @@ class Goodsclass extends AdminControl {
             $update_array['gc_virtual'] = intval(input('post.gc_virtual'));
             $update_array['gc_parent_id'] = intval(input('post.gc_parent_id'));
 
-            if (!empty($_FILES['pic']['name'])) {//上传图片
+            if (!empty($_FILES['pic']['name'])) { //上传图片
                 $res = ds_upload_pic(ATTACH_COMMON, 'pic');
                 if ($res['code']) {
                     $file_name = $res['data']['file_name'];
@@ -258,7 +263,8 @@ class Goodsclass extends AdminControl {
     /**
      * 删除分类
      */
-    public function goods_class_del() {
+    public function goods_class_del()
+    {
         $gc_id = input('param.gc_id');
         $gc_id_array = ds_delete_param($gc_id);
         if ($gc_id_array === FALSE) {
@@ -275,7 +281,8 @@ class Goodsclass extends AdminControl {
     /**
      * tag列表
      */
-    public function tag() {
+    public function tag()
+    {
 
         /**
          * 处理商品分类
@@ -317,7 +324,8 @@ class Goodsclass extends AdminControl {
     /**
      * 重置TAG
      */
-    public function tag_reset() {
+    public function tag_reset()
+    {
         //实例化模型
         $goodsclass_model = model('goodsclass');
         $classtag_model = model('goodsclasstag');
@@ -330,7 +338,7 @@ class Goodsclass extends AdminControl {
         //商品分类
         $goods_class = $goodsclass_model->getTreeClassList(3);
         //格式化分类。组成三维数组
-        if (is_array($goods_class) and ! empty($goods_class)) {
+        if (is_array($goods_class) and !empty($goods_class)) {
             $goods_class_array = array();
             foreach ($goods_class as $val) {
                 //一级分类
@@ -376,7 +384,8 @@ class Goodsclass extends AdminControl {
     /**
      * 更新TAG名称
      */
-    public function tag_update() {
+    public function tag_update()
+    {
         $goodsclass_model = model('goodsclass');
         $classtag_model = model('goodsclasstag');
 
@@ -438,7 +447,8 @@ class Goodsclass extends AdminControl {
     /**
      * 删除TAG
      */
-    public function tag_del() {
+    public function tag_del()
+    {
         $id = intval(input('get.tag_id'));
         $classtag_model = model('goodsclasstag');
         if ($id > 0) {
@@ -455,7 +465,8 @@ class Goodsclass extends AdminControl {
     /**
      * 分类导航
      */
-    public function nav_edit() {
+    public function nav_edit()
+    {
         $gc_id = input('param.gc_id');
         $goodsclass_model = model('goodsclass');
         $class_info = $goodsclass_model->getGoodsclassInfoById($gc_id);
@@ -467,20 +478,20 @@ class Goodsclass extends AdminControl {
             $update['gc_id'] = $gc_id;
             $update['goodscn_alias'] = input('post.goodscn_alias');
             $class_id_array = input('post.class_id/a');
-            if(empty($class_id_array)){
-            	$update['goodscn_classids'] = '';
-            }else if (is_array($class_id_array) && !empty($class_id_array)) {
+            if (empty($class_id_array)) {
+                $update['goodscn_classids'] = '';
+            } else if (is_array($class_id_array) && !empty($class_id_array)) {
                 $update['goodscn_classids'] = implode(',', $class_id_array);
             }
             $brand_id_array = input('post.brand_id/a');
-            if(empty($brand_id_array)){
-            	$update['goodscn_brandids'] = '';
-            }else if (is_array($brand_id_array) && !empty($brand_id_array)) {
+            if (empty($brand_id_array)) {
+                $update['goodscn_brandids'] = '';
+            } else if (is_array($brand_id_array) && !empty($brand_id_array)) {
                 $update['goodscn_brandids'] = implode(',', $brand_id_array);
             }
             $update['goodscn_adv1_link'] = input('post.goodscn_adv1_link');
             $update['goodscn_adv2_link'] = input('post.goodscn_adv2_link');
-            if (!empty($_FILES['pic']['name'])) {//上传图片
+            if (!empty($_FILES['pic']['name'])) { //上传图片
                 @unlink(BASE_UPLOAD_PATH . '/' . ATTACH_GOODS_CLASS . '/' . $nav_info['goodscn_pic']);
                 $file_name = date('YmdHis') . rand(10000, 99999) . '.png';
 
@@ -492,7 +503,7 @@ class Goodsclass extends AdminControl {
                     $this->error($res['msg']);
                 }
             }
-            if (!empty($_FILES['adv1']['name'])) {//上传广告图片
+            if (!empty($_FILES['adv1']['name'])) { //上传广告图片
                 @unlink(BASE_UPLOAD_PATH . '/' . ATTACH_GOODS_CLASS . '/' . $nav_info['goodscn_adv1']);
                 $file_name = date('YmdHis') . rand(10000, 99999) . '.png';
 
@@ -504,7 +515,7 @@ class Goodsclass extends AdminControl {
                     $this->error($res['msg']);
                 }
             }
-            if (!empty($_FILES['adv2']['name'])) {//上传广告图片
+            if (!empty($_FILES['adv2']['name'])) { //上传广告图片
                 @unlink(BASE_UPLOAD_PATH . '/' . ATTACH_GOODS_CLASS . '/' . $nav_info['goodscn_adv2']);
                 $file_name = date('YmdHis') . rand(10000, 99999) . '.png';
 
@@ -569,11 +580,12 @@ class Goodsclass extends AdminControl {
     /**
      * ajax操作
      */
-    public function ajax() {
+    public function ajax()
+    {
         $branch = input('param.branch');
         $condition = array();
         switch ($branch) {
-            /**
+                /**
              * 更新分类
              */
             case 'goods_class_name':
@@ -598,9 +610,9 @@ class Goodsclass extends AdminControl {
                     exit;
                 }
                 break;
-            /**
-             * 分类 排序 显示 设置
-             */
+                /**
+                 * 分类 排序 显示 设置
+                 */
             case 'goods_class_sort':
             case 'goods_class_show':
             case 'goods_class_index_show':
@@ -613,9 +625,9 @@ class Goodsclass extends AdminControl {
                 echo 'true';
                 exit;
                 break;
-            /**
-             * 添加、修改操作中 检测类别名称是否有重复
-             */
+                /**
+                 * 添加、修改操作中 检测类别名称是否有重复
+                 */
             case 'check_class_name':
                 $goodsclass_model = model('goodsclass');
                 $condition[] = array('gc_name', '=', trim(input('get.gc_name')));
@@ -630,9 +642,9 @@ class Goodsclass extends AdminControl {
                     exit;
                 }
                 break;
-            /**
-             * TAG值编辑
-             */
+                /**
+                 * TAG值编辑
+                 */
             case 'goods_class_tag_value':
                 $classtag_model = model('goodsclasstag');
                 $update_array = array();
@@ -651,7 +663,8 @@ class Goodsclass extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'goods_class',
@@ -680,5 +693,4 @@ class Goodsclass extends AdminControl {
         );
         return $menu_array;
     }
-
 }

+ 21 - 16
app/admin/controller/Goodsvideo.php

@@ -5,34 +5,38 @@
  */
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Goodsvideo extends AdminControl {
+class Goodsvideo extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/goodsvideo.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/goodsvideo.lang.php');
     }
 
     /**
      * 视频列表
      */
-    public function index() {
-        $goods_model=model('goods');
-        $video_list=$goods_model->getGoodsVideoList(array(),'*','goodsvideo_id desc',0,16);
-        foreach($video_list as $key => $val){
-            $video_list[$key]['goodsvideo_url']=goods_video($val['goodsvideo_name']);
+    public function index()
+    {
+        $goods_model = model('goods');
+        $video_list = $goods_model->getGoodsVideoList(array(), '*', 'goodsvideo_id desc', 0, 16);
+        foreach ($video_list as $key => $val) {
+            $video_list[$key]['goodsvideo_url'] = goods_video($val['goodsvideo_name']);
         }
         View::assign('video_list', $video_list);
         View::assign('show_page', $goods_model->page_info->render());
@@ -44,14 +48,15 @@ class Goodsvideo extends AdminControl {
      * 删除视频
      *
      */
-    public function del_video() {
+    public function del_video()
+    {
         $goodsvideo_id = input('param.goodsvideo_id');
         $goodsvideo_id_array = ds_delete_param($goodsvideo_id);
         if ($goodsvideo_id_array === FALSE) {
             ds_json_encode('10001', lang('param_error'));
         }
-        $condition=array();
-        $condition[]=array('goodsvideo_id','in',$goodsvideo_id_array);
+        $condition = array();
+        $condition[] = array('goodsvideo_id', 'in', $goodsvideo_id_array);
         $goods_model = model('goods');
         //批量删除视频
         $goods_model->delGoodsVideo($condition);
@@ -60,7 +65,8 @@ class Goodsvideo extends AdminControl {
     }
 
 
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -70,5 +76,4 @@ class Goodsvideo extends AdminControl {
         );
         return $menu_array;
     }
-
 }

+ 3 - 3
app/admin/controller/Groupbuy.php

@@ -10,13 +10,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Groupbuy extends AdminControl

+ 3 - 3
app/admin/controller/Inform.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Inform extends AdminControl

+ 32 - 25
app/admin/controller/InstantMessage.php

@@ -5,23 +5,27 @@
  */
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Db;
 use think\facade\Lang;
 use GatewayClient\Gateway;
+
 /**
- * ============================================================================
+ 
  * DSKMS多用户商城
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class InstantMessage extends AdminControl {
+class InstantMessage extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
         Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/instant_message.lang.php');
     }
@@ -29,36 +33,37 @@ class InstantMessage extends AdminControl {
     /**
      * 商品管理
      */
-    public function index() {
+    public function index()
+    {
         $instant_message_model = model('instant_message');
         $f_name = trim(input('param.f_name'));
         $t_name = trim(input('param.t_name'));
-        $time_add_from = input('param.add_time_from')?strtotime(input('param.add_time_from')):'';
-        $time_add_to = input('param.add_time_to')?strtotime(input('param.add_time_to')):'';
+        $time_add_from = input('param.add_time_from') ? strtotime(input('param.add_time_from')) : '';
+        $time_add_to = input('param.add_time_to') ? strtotime(input('param.add_time_to')) : '';
         /**
          * 查询条件
          */
         $condition = array();
-        if($f_name){
-            $condition[]=array('instant_message_from_name','like','%'.$f_name.'%');
+        if ($f_name) {
+            $condition[] = array('instant_message_from_name', 'like', '%' . $f_name . '%');
         }
-        if($t_name){
-            $condition[]=array('instant_message_to_name','like','%'.$t_name.'%');
+        if ($t_name) {
+            $condition[] = array('instant_message_to_name', 'like', '%' . $t_name . '%');
         }
-        if($time_add_from){
-            $condition[]=array('instant_message_add_time','>=',$time_add_from);
+        if ($time_add_from) {
+            $condition[] = array('instant_message_add_time', '>=', $time_add_from);
         }
-        if($time_add_to){
-            $condition[]=array('instant_message_add_time','>=',$time_add_to);
+        if ($time_add_to) {
+            $condition[] = array('instant_message_add_time', '>=', $time_add_to);
         }
         $instant_message_open = input('param.instant_message_open');
         if (in_array($instant_message_open, array('0', '1', '2'))) {
-            $condition[]=array('instant_message_open','=',$instant_message_open);
+            $condition[] = array('instant_message_open', '=', $instant_message_open);
         }
 
         $instant_message_list = $instant_message_model->getInstantMessageList($condition, 10);
-        foreach($instant_message_list as $key => $val){
-            $instant_message_list[$key]=$instant_message_model->formatInstantMessage($val);
+        foreach ($instant_message_list as $key => $val) {
+            $instant_message_list[$key] = $instant_message_model->formatInstantMessage($val);
         }
         View::assign('instant_message_list', $instant_message_list);
         View::assign('show_page', $instant_message_model->page_info->render());
@@ -74,14 +79,15 @@ class InstantMessage extends AdminControl {
     /**
      * 删除商品
      */
-    public function del() {
+    public function del()
+    {
         $instant_message_id = input('param.instant_message_id');
         $instant_message_id_array = ds_delete_param($instant_message_id);
         if ($instant_message_id_array == FALSE) {
             ds_json_encode('10001', lang('ds_common_op_fail'));
         }
         $condition = array();
-        $condition[] = array('instant_message_id','in', $instant_message_id_array);
+        $condition[] = array('instant_message_id', 'in', $instant_message_id_array);
         model('instant_message')->delInstantMessage($condition);
         $this->log(lang('ds_del') . lang('instant_message') . ' ID:' . implode('、', $instant_message_id_array), 1);
         ds_json_encode('10000', lang('ds_common_op_succ'));
@@ -90,7 +96,8 @@ class InstantMessage extends AdminControl {
     /*
      * 直播设置
      */
-    public function setting() {
+    public function setting()
+    {
         $config_model = model('config');
         if (!request()->isPost()) {
             $list_config = rkcache('config', true);
@@ -98,7 +105,7 @@ class InstantMessage extends AdminControl {
             $this->setAdminCurItem('setting');
             return View::fetch();
         } else {
-            $update_array=array();
+            $update_array = array();
             $update_array['instant_message_gateway_url'] = input('param.instant_message_gateway_url');
             $update_array['instant_message_register_url'] = input('param.instant_message_register_url');
             $update_array['instant_message_open'] = input('param.instant_message_open');
@@ -115,7 +122,8 @@ class InstantMessage extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -130,5 +138,4 @@ class InstantMessage extends AdminControl {
         );
         return $menu_array;
     }
-
 }

+ 3 - 3
app/admin/controller/Inviter.php

@@ -11,13 +11,13 @@ use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Inviter extends AdminControl

+ 3 - 3
app/admin/controller/Link.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Link extends AdminControl

+ 64 - 59
app/admin/controller/LiveApply.php

@@ -19,18 +19,20 @@ use TencentCloud\Live\V20180801\Models\DescribeLiveStreamStateRequest;
 use AlibabaCloud\Client\AlibabaCloud;
 
 /**
- * ============================================================================
+ 
  * DSKMS多用户商城
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class LiveApply extends AdminControl {
+class LiveApply extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
         Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/live_apply.lang.php');
     }
@@ -38,7 +40,8 @@ class LiveApply extends AdminControl {
     /**
      * 商品管理
      */
-    public function index() {
+    public function index()
+    {
         /**
          * 查询条件
          */
@@ -49,7 +52,7 @@ class LiveApply extends AdminControl {
             $minipro_live_list = $minipro_live_model->getMiniproLiveList($condition);
             $store_list = array();
             foreach ($minipro_live_list as $key => $val) {
-                $minipro_live_list[$key]['minipro_live_image_url'] = ds_get_pic( ATTACH_MINIPRO_LIVE , $val['minipro_live_image']);
+                $minipro_live_list[$key]['minipro_live_image_url'] = ds_get_pic(ATTACH_MINIPRO_LIVE, $val['minipro_live_image']);
                 if (!isset($store_list[$val['store_id']])) {
                     $store_list[$val['store_id']] = $store_model->getStoreInfo(array('store_id' => $val['store_id']));
                 }
@@ -69,11 +72,11 @@ class LiveApply extends AdminControl {
             $store_list = array();
             foreach ($live_apply_list as $key => $val) {
                 if ($val['live_apply_cover_video']) {
-                    $live_apply_list[$key]['live_apply_cover_video_url'] = ds_get_pic( ATTACH_LIVE_APPLY . '/' . $val['live_apply_user_id'] , $val['live_apply_cover_video']);
+                    $live_apply_list[$key]['live_apply_cover_video_url'] = ds_get_pic(ATTACH_LIVE_APPLY . '/' . $val['live_apply_user_id'], $val['live_apply_cover_video']);
                 } elseif ($val['live_apply_cover_image']) {
-                    $live_apply_list[$key]['live_apply_cover_image_url'] = ds_get_pic( ATTACH_LIVE_APPLY . '/' . $val['live_apply_user_id'] , $val['live_apply_cover_image']);
+                    $live_apply_list[$key]['live_apply_cover_image_url'] = ds_get_pic(ATTACH_LIVE_APPLY . '/' . $val['live_apply_user_id'], $val['live_apply_cover_image']);
                 } else {
-                    $live_apply_list[$key]['live_apply_cover_image_url'] = ds_get_pic(ATTACH_COMMON,config('ds_config.default_goods_image'));
+                    $live_apply_list[$key]['live_apply_cover_image_url'] = ds_get_pic(ATTACH_COMMON, config('ds_config.default_goods_image'));
                 }
                 $live_apply_list[$key]['live_apply_user_name'] = '';
                 switch ($val['live_apply_user_type']) {
@@ -99,7 +102,8 @@ class LiveApply extends AdminControl {
     /**
      * 删除商品
      */
-    public function del() {
+    public function del()
+    {
         $live_apply_id = input('param.live_apply_id');
         $live_apply_id_array = ds_delete_param($live_apply_id);
         if ($live_apply_id_array == FALSE) {
@@ -115,7 +119,8 @@ class LiveApply extends AdminControl {
     /**
      * 审核商品
      */
-    public function view() {
+    public function view()
+    {
         if (config('ds_config.live_type') == 1) {
             $minipro_live_id = input('param.minipro_live_id');
             $minipro_live_model = model('minipro_live');
@@ -123,7 +128,7 @@ class LiveApply extends AdminControl {
             if (!$minipro_live_info) {
                 $this->error(lang('live_not_exist'));
             }
-            $minipro_live_info['minipro_live_image_url'] = ds_get_pic( ATTACH_MINIPRO_LIVE , $minipro_live_info['minipro_live_image']);
+            $minipro_live_info['minipro_live_image_url'] = ds_get_pic(ATTACH_MINIPRO_LIVE, $minipro_live_info['minipro_live_image']);
             $minipro_live_room_goods_model = model('minipro_live_room_goods');
             $goods_list = $minipro_live_room_goods_model->getMiniproLiveRoomGoodsList(array(array('minipro_live_id', '=', $minipro_live_id)));
             foreach ($goods_list as $k => $v) {
@@ -186,7 +191,7 @@ class LiveApply extends AdminControl {
                                                 )
                                             ),
                                         );
-                                        model('cron')->addCron(array('cron_exetime'=>TIMESTAMP,'cron_type'=>'sendStoremsg','cron_value'=>serialize($param)));
+                                        model('cron')->addCron(array('cron_exetime' => TIMESTAMP, 'cron_type' => 'sendStoremsg', 'cron_value' => serialize($param)));
                                     }
                                 }
                             }
@@ -232,36 +237,35 @@ class LiveApply extends AdminControl {
                         }
                         $regionId = 'cn-shanghai';
                         AlibabaCloud::accessKeyClient(config('ds_config.aliyun_access_key_id'), config('ds_config.aliyun_access_key_secret'))
-                                ->regionId($regionId)
-                                ->asDefaultClient();
+                            ->regionId($regionId)
+                            ->asDefaultClient();
 
                         try {
                             $result = AlibabaCloud::rpc()
-                                    ->product('live')
-                                    // ->scheme('https') // https | http
-                                    ->version('2016-11-01')
-                                    ->action('DescribeLiveStreamsOnlineList')
-                                    ->method('POST')
-                                    ->host('live.aliyuncs.com')
-                                    ->options([
-                                        'query' => [
-                                            'RegionId' => $regionId,
-                                            'DomainName' => config('ds_config.aliyun_live_push_domain'),
-                                            'AppName' => "live",
-                                            'StreamName' => 'live_apply_' . $live_apply_info['live_apply_id'],
-                                            'PageSize' => "1",
-                                            'PageNum' => "1",
-                                            'QueryType' => "strict",
-                                        ],
-                                    ])
-                                    ->request();
+                                ->product('live')
+                                // ->scheme('https') // https | http
+                                ->version('2016-11-01')
+                                ->action('DescribeLiveStreamsOnlineList')
+                                ->method('POST')
+                                ->host('live.aliyuncs.com')
+                                ->options([
+                                    'query' => [
+                                        'RegionId' => $regionId,
+                                        'DomainName' => config('ds_config.aliyun_live_push_domain'),
+                                        'AppName' => "live",
+                                        'StreamName' => 'live_apply_' . $live_apply_info['live_apply_id'],
+                                        'PageSize' => "1",
+                                        'PageNum' => "1",
+                                        'QueryType' => "strict",
+                                    ],
+                                ])
+                                ->request();
                             if ($result->TotalNum) {
                                 $live_apply_info['active'] = true;
                                 //生成播放地址
                                 $live_apply_info['live_apply_play_url'] = model('live_apply')->getPlayUrl('live_apply_' . $live_apply_info['live_apply_id'], $live_apply_info['live_apply_end_time']);
                             }
                         } catch (\Exception $e) {
-                            
                         }
                     } else {
                         if (!config('ds_config.live_push_domain')) {
@@ -302,11 +306,11 @@ class LiveApply extends AdminControl {
                     }
                 }
                 if ($live_apply_info['live_apply_cover_video']) {
-                    $live_apply_info['live_apply_cover_video_url'] = ds_get_pic( ATTACH_LIVE_APPLY . '/' . $live_apply_info['live_apply_user_id'] , $live_apply_info['live_apply_cover_video']);
+                    $live_apply_info['live_apply_cover_video_url'] = ds_get_pic(ATTACH_LIVE_APPLY . '/' . $live_apply_info['live_apply_user_id'], $live_apply_info['live_apply_cover_video']);
                 } elseif ($live_apply_info['live_apply_cover_image']) {
-                    $live_apply_info['live_apply_cover_image_url'] = ds_get_pic( ATTACH_LIVE_APPLY . '/' . $live_apply_info['live_apply_user_id'] , $live_apply_info['live_apply_cover_image']);
+                    $live_apply_info['live_apply_cover_image_url'] = ds_get_pic(ATTACH_LIVE_APPLY . '/' . $live_apply_info['live_apply_user_id'], $live_apply_info['live_apply_cover_image']);
                 } else {
-                    $live_apply_info['live_apply_cover_image_url'] = ds_get_pic(ATTACH_COMMON,config('ds_config.default_goods_image'));
+                    $live_apply_info['live_apply_cover_image_url'] = ds_get_pic(ATTACH_COMMON, config('ds_config.default_goods_image'));
                 }
                 $goods_commonid = Db::name('live_apply_goods')->where('live_apply_id', $live_apply_info['live_apply_id'])->column('goods_commonid');
                 $goods_model = model('goods');
@@ -325,7 +329,8 @@ class LiveApply extends AdminControl {
         }
     }
 
-    public function close() {
+    public function close()
+    {
         $live_apply_id = input('param.live_apply_id');
         $live_apply_model = model('live_apply');
         $live_apply = $live_apply_model->getLiveApplyInfo(array('live_apply_id' => $live_apply_id));
@@ -335,27 +340,27 @@ class LiveApply extends AdminControl {
         if (config('ds_config.video_type') == 'aliyun') {
             $regionId = 'cn-shanghai';
             AlibabaCloud::accessKeyClient(config('ds_config.aliyun_access_key_id'), config('ds_config.aliyun_access_key_secret'))
-                    ->regionId($regionId)
-                    ->asDefaultClient();
+                ->regionId($regionId)
+                ->asDefaultClient();
 
             try {
                 $result = AlibabaCloud::rpc()
-                        ->product('live')
-                        // ->scheme('https') // https | http
-                        ->version('2016-11-01')
-                        ->action('ForbidLiveStream')
-                        ->method('POST')
-                        ->host('live.aliyuncs.com')
-                        ->options([
-                            'query' => [
-                                'RegionId' => $regionId,
-                                'AppName' => "live",
-                                'StreamName' => 'live_apply_' . $live_apply['live_apply_id'],
-                                'LiveStreamType' => "publisher",
-                                'DomainName' => config('ds_config.aliyun_live_push_domain'),
-                            ],
-                        ])
-                        ->request();
+                    ->product('live')
+                    // ->scheme('https') // https | http
+                    ->version('2016-11-01')
+                    ->action('ForbidLiveStream')
+                    ->method('POST')
+                    ->host('live.aliyuncs.com')
+                    ->options([
+                        'query' => [
+                            'RegionId' => $regionId,
+                            'AppName' => "live",
+                            'StreamName' => 'live_apply_' . $live_apply['live_apply_id'],
+                            'LiveStreamType' => "publisher",
+                            'DomainName' => config('ds_config.aliyun_live_push_domain'),
+                        ],
+                    ])
+                    ->request();
             } catch (\Exception $e) {
                 ds_json_encode(10001, $e->getMessage());
             }
@@ -388,7 +393,8 @@ class LiveApply extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -398,5 +404,4 @@ class LiveApply extends AdminControl {
         );
         return $menu_array;
     }
-
 }

+ 3 - 3
app/admin/controller/LiveGoods.php

@@ -11,13 +11,13 @@ use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class LiveGoods extends AdminControl

+ 13 - 9
app/admin/controller/LiveSetting.php

@@ -5,27 +5,31 @@
  */
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * DSKMS多用户商城
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class LiveSetting extends AdminControl {
+class LiveSetting extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
         Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/live_setting.lang.php');
     }
 
-    public function index() {
+    public function index()
+    {
         $config_model = model('config');
         if (!request()->isPost()) {
             $list_config = rkcache('config', true);
@@ -33,7 +37,7 @@ class LiveSetting extends AdminControl {
             $this->setAdminCurItem('index');
             return View::fetch();
         } else {
-            $update_array=array();
+            $update_array = array();
             $update_array['live_type'] = input('post.live_type');
             $update_array['vod_tencent_play_key'] = input('post.vod_tencent_play_key');
             $update_array['vod_tencent_appid'] = input('post.vod_tencent_appid');
@@ -64,7 +68,8 @@ class LiveSetting extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -74,5 +79,4 @@ class LiveSetting extends AdminControl {
         );
         return $menu_array;
     }
-
 }

+ 3 - 3
app/admin/controller/Mallconsult.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Mallconsult extends AdminControl

+ 3 - 3
app/admin/controller/Mallvouchertemplate.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Mallvouchertemplate extends AdminControl

+ 3 - 3
app/admin/controller/Marketmanage.php

@@ -7,13 +7,13 @@ use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 营销活动管理  包含刮刮卡\大转盘\砸金蛋\生肖翻翻看
  */
 class Marketmanage extends AdminControl

+ 57 - 49
app/admin/controller/Member.php

@@ -1,28 +1,32 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Member extends AdminControl {
+class Member extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/member.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/member.lang.php');
     }
 
-    public function member() {
+    public function member()
+    {
         $member_model = model('member');
 
 
@@ -34,47 +38,47 @@ class Member extends AdminControl {
         if ($search_field_value != '') {
             switch ($search_field_name) {
                 case 'member_name':
-                    $condition[]=array('member_name','like', '%' . trim($search_field_value) . '%');
+                    $condition[] = array('member_name', 'like', '%' . trim($search_field_value) . '%');
                     break;
                 case 'member_email':
-                    $condition[]=array('member_email','like', '%' . trim($search_field_value) . '%');
+                    $condition[] = array('member_email', 'like', '%' . trim($search_field_value) . '%');
                     break;
                 case 'member_mobile':
-                    $condition[]=array('member_mobile','like', '%' . trim($search_field_value) . '%');
+                    $condition[] = array('member_mobile', 'like', '%' . trim($search_field_value) . '%');
                     break;
                 case 'member_truename':
-                    $condition[]=array('member_truename','like', '%' . trim($search_field_value) . '%');
+                    $condition[] = array('member_truename', 'like', '%' . trim($search_field_value) . '%');
                     break;
             }
         }
         $search_state = input('search_state');
         switch ($search_state) {
             case 'no_informallow':
-                $condition[]=array('inform_allow','=','2');
+                $condition[] = array('inform_allow', '=', '2');
                 break;
             case 'no_isbuy':
-                $condition[]=array('is_buylimit','=','0');
+                $condition[] = array('is_buylimit', '=', '0');
                 break;
             case 'no_isallowtalk':
-                $condition[]=array('is_allowtalk','=','0');
+                $condition[] = array('is_allowtalk', '=', '0');
                 break;
             case 'no_memberstate':
-                $condition[]=array('member_state','=','0');
+                $condition[] = array('member_state', '=', '0');
                 break;
         }
         //会员等级
         $search_grade = intval(input('get.search_grade'));
-        if ($search_grade>0 && $member_grade) {
+        if ($search_grade > 0 && $member_grade) {
             if (isset($member_grade[$search_grade + 1]['exppoints'])) {
-                $condition[] = array('member_exppoints','between',array($member_grade[$search_grade]['exppoints'],$member_grade[$search_grade + 1]['exppoints']));
-            }else{
-                $condition[]=array('member_exppoints','>=', $member_grade[$search_grade]['exppoints']);
+                $condition[] = array('member_exppoints', 'between', array($member_grade[$search_grade]['exppoints'], $member_grade[$search_grade + 1]['exppoints']));
+            } else {
+                $condition[] = array('member_exppoints', '>=', $member_grade[$search_grade]['exppoints']);
             }
         }
 
         //排序
         $order = trim(input('get.search_sort'));
-        if (!in_array($order,array('member_logintime desc','member_loginnum desc'))) {
+        if (!in_array($order, array('member_logintime desc', 'member_loginnum desc'))) {
             $order = 'member_id desc';
         }
         $member_list = $member_model->getMemberList($condition, '*', 10, $order);
@@ -99,7 +103,8 @@ class Member extends AdminControl {
         return View::fetch();
     }
 
-    public function add() {
+    public function add()
+    {
         if (!request()->isPost()) {
             return View::fetch();
         } else {
@@ -118,7 +123,7 @@ class Member extends AdminControl {
                 'inform_allow' => 1, //默认允许举报商品
             );
             $member_validate = ds_validate('member');
-            if (!$member_validate->scene('add')->check($data)){
+            if (!$member_validate->scene('add')->check($data)) {
                 $this->error($member_validate->getError());
             }
             $result = $member_model->addMember($data);
@@ -130,23 +135,24 @@ class Member extends AdminControl {
         }
     }
 
-    public function edit() {
+    public function edit()
+    {
         //注:pathinfo地址参数不能通过get方法获取,查看“获取PARAM变量”
         $member_id = intval(input('param.member_id'));
         if (empty($member_id)) {
             $this->error(lang('param_error'));
         }
         $member_model = model('member');
-            $condition = array();
-            $condition[] = array('member_id','=',$member_id);
-            $member_array = $member_model->getMemberInfo($condition);
+        $condition = array();
+        $condition[] = array('member_id', '=', $member_id);
+        $member_array = $member_model->getMemberInfo($condition);
         if (!request()->isPost()) {
             View::assign('member_array', $member_array);
             return View::fetch();
         } else {
-            $member_mobile=input('post.member_mobile');
-            if($member_mobile==encrypt_show($member_array['member_mobile'],4,4)){
-                $member_mobile=$member_array['member_mobile'];
+            $member_mobile = input('post.member_mobile');
+            if ($member_mobile == encrypt_show($member_array['member_mobile'], 4, 4)) {
+                $member_mobile = $member_array['member_mobile'];
             }
             $data = array(
                 'member_email' => input('post.member_email'),
@@ -176,12 +182,12 @@ class Member extends AdminControl {
             }
 
             $member_validate = ds_validate('member');
-            if (!$member_validate->scene('edit')->check($data)){
+            if (!$member_validate->scene('edit')->check($data)) {
                 $this->error($member_validate->getError());
             }
 
-            $result = $member_model->editMember(array('member_id'=>$member_id),$data,$member_id);
-            if ($result>=0) {
+            $result = $member_model->editMember(array('member_id' => $member_id), $data, $member_id);
+            if ($result >= 0) {
                 dsLayerOpenSuccess(lang('ds_common_op_succ'));
             } else {
                 $this->error(lang('ds_common_op_fail'));
@@ -192,17 +198,18 @@ class Member extends AdminControl {
     /**
      * ajax操作
      */
-    public function ajax() {
+    public function ajax()
+    {
         $branch = input('param.branch');
-        $condition=array();
+        $condition = array();
         switch ($branch) {
-            /**
+                /**
              * 验证会员是否重复
              */
             case 'check_user_name':
                 $member_model = model('member');
-                $condition[]=array('member_name','=',input('param.member_name'));
-                $condition[]=array('member_id','<>', intval(input('get.member_id')));
+                $condition[] = array('member_name', '=', input('param.member_name'));
+                $condition[] = array('member_id', '<>', intval(input('get.member_id')));
                 $list = $member_model->getMemberInfo($condition);
                 if (empty($list)) {
                     echo 'true';
@@ -212,13 +219,13 @@ class Member extends AdminControl {
                     exit;
                 }
                 break;
-            /**
-             * 验证邮件是否重复
-             */
+                /**
+                 * 验证邮件是否重复
+                 */
             case 'check_email':
                 $member_model = model('member');
-                $condition[]=array('member_email','=',input('param.member_email'));
-                $condition[]=array('member_id','<>', intval(input('param.member_id')));
+                $condition[] = array('member_email', '=', input('param.member_email'));
+                $condition[] = array('member_id', '<>', intval(input('param.member_id')));
                 $list = $member_model->getMemberInfo($condition);
                 if (empty($list)) {
                     echo 'true';
@@ -234,7 +241,8 @@ class Member extends AdminControl {
     /**
      * 设置会员状态
      */
-    public function memberstate() {
+    public function memberstate()
+    {
         $member_id = input('param.member_id');
         $member_id_array = ds_delete_param($member_id);
         if ($member_id_array == FALSE) {
@@ -243,15 +251,15 @@ class Member extends AdminControl {
         $data['member_state'] = input('param.member_state') ? input('param.member_state') : 0;
 
         $condition = array();
-        $condition[]=array('member_id','in', $member_id_array);
+        $condition[] = array('member_id', 'in', $member_id_array);
         $result = Db::name('member')->where($condition)->update($data);
-        if ($result>=0) {
+        if ($result >= 0) {
             foreach ($member_id_array as $key => $member_id) {
                 dcache($member_id, 'member');
             }
             $this->log(lang('ds_edit') .  '[ID:' . implode(',', $member_id_array) . ']', 1);
             ds_json_encode('10000', lang('ds_common_op_succ'));
-        }else{
+        } else {
             ds_json_encode('10001', lang('ds_common_op_fail'));
         }
     }
@@ -259,7 +267,8 @@ class Member extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'member',
@@ -271,10 +280,9 @@ class Member extends AdminControl {
             $menu_array[] = array(
                 'name' => 'add',
                 'text' => lang('ds_add'),
-                'url' => "javascript:dsLayerOpen('".(string)url('Member/add')."','".lang('ds_add')."')"
+                'url' => "javascript:dsLayerOpen('" . (string)url('Member/add') . "','" . lang('ds_add') . "')"
             );
         }
         return $menu_array;
     }
-
 }

+ 52 - 46
app/admin/controller/MemberAuth.php

@@ -1,73 +1,78 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 use PHPExcel;
+
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class MemberAuth extends AdminControl {
+class MemberAuth extends AdminControl
+{
 
     const EXPORT_SIZE = 1000;
-    
-    public function initialize() {
+
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/member.lang.php');
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/member_auth.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/member.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/member_auth.lang.php');
     }
 
-    public function index() {
+    public function index()
+    {
         $member_model = model('member');
-        
+
         $search_field_value = input('search_field_value');
         $search_field_name = input('search_field_name');
         $condition = '1=1';
-        $filtered=0;
+        $filtered = 0;
         $default_condition = array();
         if ($search_field_value != '') {
             switch ($search_field_name) {
                 case 'member_name':
-                    $condition.=' AND member_name LIKE "%' . trim($search_field_value) . '%"';
-                    $filtered=1;
+                    $condition .= ' AND member_name LIKE "%' . trim($search_field_value) . '%"';
+                    $filtered = 1;
                     break;
                 case 'member_email':
-                    $condition.=' AND member_email LIKE "%' . trim($search_field_value) . '%"';
-                    $filtered=1;
+                    $condition .= ' AND member_email LIKE "%' . trim($search_field_value) . '%"';
+                    $filtered = 1;
                     break;
                 case 'member_mobile':
-                    $condition.=' AND member_mobile LIKE "%' . trim($search_field_value) . '%"';
-                    $filtered=1;
+                    $condition .= ' AND member_mobile LIKE "%' . trim($search_field_value) . '%"';
+                    $filtered = 1;
                     break;
                 case 'member_truename':
-                    $condition.=' AND member_truename LIKE "%' . trim($search_field_value) . '%"';
-                    $filtered=1;
+                    $condition .= ' AND member_truename LIKE "%' . trim($search_field_value) . '%"';
+                    $filtered = 1;
                     break;
             }
         }
         $search_state = input('search_state');
         switch ($search_state) {
             case 'check':
-                $condition.=' AND member_auth_state=1';
-                $filtered=1;
+                $condition .= ' AND member_auth_state=1';
+                $filtered = 1;
                 break;
             case 'pass':
-                $condition.=' AND member_auth_state=3';
-                $filtered=1;
+                $condition .= ' AND member_auth_state=3';
+                $filtered = 1;
                 break;
             case 'fail':
-                $condition.=' AND member_auth_state=2';
-                $filtered=1;
+                $condition .= ' AND member_auth_state=2';
+                $filtered = 1;
                 break;
             default:
-                $condition.=' AND member_auth_state IN (1,2,3)';
+                $condition .= ' AND member_auth_state IN (1,2,3)';
         }
         $member_list = $member_model->getMemberList($condition, '*', 10, 'member_id desc');
         //整理会员信息
@@ -86,34 +91,35 @@ class MemberAuth extends AdminControl {
         $this->setAdminCurItem('index');
         return View::fetch();
     }
-    
-    public function verify(){
+
+    public function verify()
+    {
         $member_id = input('param.member_id');
         $state = input('param.state');
         $message = input('param.message');
         $member_id_array = ds_delete_param($member_id);
-        if ($member_id_array == FALSE || !in_array($state, array(1,2))) {
+        if ($member_id_array == FALSE || !in_array($state, array(1, 2))) {
             ds_json_encode(10001, lang('param_error'));
         }
-        
-        if($state==1){
-            $update=array('member_auth_state'=>3);
-        }else{
-            $update=array('member_auth_state'=>2);
+
+        if ($state == 1) {
+            $update = array('member_auth_state' => 3);
+        } else {
+            $update = array('member_auth_state' => 2);
         }
-        if(!model('member')->editMember(array(array('member_auth_state','=',1),array('member_id','in',$member_id_array)),$update)){
+        if (!model('member')->editMember(array(array('member_auth_state', '=', 1), array('member_id', 'in', $member_id_array)), $update)) {
             ds_json_encode(10001, lang('ds_common_op_fail'));
         }
-        if($message){
+        if ($message) {
             //添加短消息
-                $message_model = model('message');
-                $insert_arr = array();
-                $insert_arr['from_member_id'] = 0;
-                $insert_arr['member_id'] = "," . implode(',', $member_id_array) . ",";
-                $insert_arr['msg_content'] = lang('member_auth_fail').':'.$message;
-                $insert_arr['message_type'] = 1;
-                $insert_arr['message_ismore'] = 1;
-                $message_model->addMessage($insert_arr);
+            $message_model = model('message');
+            $insert_arr = array();
+            $insert_arr['from_member_id'] = 0;
+            $insert_arr['member_id'] = "," . implode(',', $member_id_array) . ",";
+            $insert_arr['msg_content'] = lang('member_auth_fail') . ':' . $message;
+            $insert_arr['message_type'] = 1;
+            $insert_arr['message_ismore'] = 1;
+            $message_model->addMessage($insert_arr);
         }
         ds_json_encode(10000, lang('ds_common_op_succ'));
     }
@@ -121,7 +127,8 @@ class MemberAuth extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -132,5 +139,4 @@ class MemberAuth extends AdminControl {
 
         return $menu_array;
     }
-
 }

+ 3 - 3
app/admin/controller/Membergrade.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Membergrade extends AdminControl

+ 123 - 92
app/admin/controller/Message.php

@@ -1,31 +1,36 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 use AlibabaCloud\Client\AlibabaCloud;
+
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Message extends AdminControl {
+class Message extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
 
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/message.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/message.lang.php');
     }
 
     /**
      * 邮件设置
      */
-    public function email() {
+    public function email()
+    {
         $config_model = model('config');
         if (!(request()->isPost())) {
             $list_config = rkcache('config', true);
@@ -56,15 +61,16 @@ class Message extends AdminControl {
     /**
      * 短信平台设置
      */
-    public function mobile() {
+    public function mobile()
+    {
         $config_model = model('config');
         if (!(request()->isPost())) {
             $list_config = rkcache('config', true);
 
             $smscf_num = '';
-            if($list_config['smscf_type']=='wj' && !empty($list_config['smscf_wj_username'])&&!empty($list_config['smscf_wj_key'])){
+            if ($list_config['smscf_type'] == 'wj' && !empty($list_config['smscf_wj_username']) && !empty($list_config['smscf_wj_key'])) {
                 //如果配置了信息,可以查看具体可用短信条数
-                $smscf_num = http_request('http://www.smschinese.cn/web_api/SMS/?Action=SMS_Num&Uid='.$list_config['smscf_wj_username'].'&Key='.$list_config['smscf_wj_key'],'get');
+                $smscf_num = http_request('http://www.smschinese.cn/web_api/SMS/?Action=SMS_Num&Uid=' . $list_config['smscf_wj_username'] . '&Key=' . $list_config['smscf_wj_key'], 'get');
             }
             View::assign('smscf_num', $smscf_num);
             View::assign('list_config', $list_config);
@@ -107,32 +113,32 @@ class Message extends AdminControl {
         if (trim($add_time_from) != '') {
             $add_time_from = strtotime(trim($add_time_from));
             if ($add_time_from !== false) {
-                $condition[]=array('smslog_smstime','>=', $add_time_from);
+                $condition[] = array('smslog_smstime', '>=', $add_time_from);
             }
         }
         if (trim($add_time_to) != '') {
             $add_time_to = strtotime(trim($add_time_to));
             if ($add_time_to !== false) {
-                $add_time_to=$add_time_to+86399;
-                $condition[]=array('smslog_smstime','<=', $add_time_to);
+                $add_time_to = $add_time_to + 86399;
+                $condition[] = array('smslog_smstime', '<=', $add_time_to);
             }
         }
         $member_name = input('get.member_name');
-        if(!empty($member_name)){
-            $condition[]=array('member_name','like',"%" . $member_name . "%");
+        if (!empty($member_name)) {
+            $condition[] = array('member_name', 'like', "%" . $member_name . "%");
         }
         $smslog_phone = input('get.smslog_phone');
-        if(!empty($smslog_phone)){
-            $condition[]=array('smslog_phone','like',"%" . $smslog_phone . "%");
+        if (!empty($smslog_phone)) {
+            $condition[] = array('smslog_phone', 'like', "%" . $smslog_phone . "%");
         }
         View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
-        $condition[]=array('smslog_state','<>',0);
+        $condition[] = array('smslog_state', '<>', 0);
         $smslog_model = model('smslog');
-        $smslog_list = $smslog_model->getSmsList($condition,10);
+        $smslog_list = $smslog_model->getSmsList($condition, 10);
         View::assign('smslog_list', $smslog_list);
         View::assign('show_page', $smslog_model->page_info->render());
 
-        
+
 
         $this->setAdminCurItem('smslog');
         return View::fetch();
@@ -141,7 +147,8 @@ class Message extends AdminControl {
     /**
      * 短信日志删除
      */
-    public function smslog_del(){
+    public function smslog_del()
+    {
         $smslog_id = input('param.smslog_id');
         $smslog_id_array = ds_delete_param($smslog_id);
         if ($smslog_id_array === FALSE) {
@@ -149,7 +156,7 @@ class Message extends AdminControl {
         }
         $condition = array();
         $smslog_model = model('smslog');
-        $condition[]=array('smslog_id','in', $smslog_id_array);
+        $condition[] = array('smslog_id', 'in', $smslog_id_array);
         $smslog_list = $smslog_model->delSmsLog($condition);
         if ($smslog_list) {
             ds_json_encode(10000, lang('ds_common_del_succ'));
@@ -161,7 +168,8 @@ class Message extends AdminControl {
     /**
      * 邮件模板列表
      */
-    public function email_tpl() {
+    public function email_tpl()
+    {
         $mailtemplates_model = model('mailtemplates');
         $templates_list = $mailtemplates_model->getTplList();
         View::assign('templates_list', $templates_list);
@@ -172,7 +180,8 @@ class Message extends AdminControl {
     /**
      * 编辑邮件模板
      */
-    public function email_tpl_edit() {
+    public function email_tpl_edit()
+    {
         $mailtemplates_model = model('mailtemplates');
         if (!request()->isPost()) {
             if (!(input('param.code'))) {
@@ -197,7 +206,7 @@ class Message extends AdminControl {
                 $update_array['mailmt_title'] = input('post.title');
                 $update_array['mailmt_content'] = input('post.content');
                 $result = $mailtemplates_model->editTpl($update_array, array('mailmt_code' => input('post.code')));
-                if ($result>=0) {
+                if ($result >= 0) {
                     $this->log(lang('ds_edit') . lang('email_tpl'), 1);
                     $this->success(lang('mailtemplates_edit_succ'), 'admin/Message/email_tpl');
                 } else {
@@ -214,7 +223,8 @@ class Message extends AdminControl {
      * @param
      * @return
      */
-    public function email_testing() {
+    public function email_testing()
+    {
         /**
          * 读取语言包
          */
@@ -237,7 +247,7 @@ class Message extends AdminControl {
         $email_id = '';
         $email_pass = '';
         $email_test = '181814630@qq.com';
-        */
+         */
 
         $site_name = config('ds_config.site_name');
         $message = '<p>' . lang('this_is_to') . "<a href='" . $site_url . "' target='_blank'>" . $site_name . '</a>' . lang('test_email_set_ok') . '</p>';
@@ -253,10 +263,12 @@ class Message extends AdminControl {
         $result = $obj_email->send($email_test, $subject, $message);
         if ($result === false) {
             $data['msg'] = lang('test_email_send_fail');
-            echo json_encode($data);exit;
+            echo json_encode($data);
+            exit;
         } else {
             $data['msg'] = lang('test_email_send_ok');
-            echo json_encode($data);exit;
+            echo json_encode($data);
+            exit;
         }
     }
 
@@ -266,7 +278,8 @@ class Message extends AdminControl {
      * @param
      * @return
      */
-    public function mobile_testing() {
+    public function mobile_testing()
+    {
         $mobile = input('param.mobile_test');
         $content = input('param.mobile_test_content');
         $smscf_type = input('param.smscf_type');
@@ -345,14 +358,15 @@ class Message extends AdminControl {
     /**
      * 商家消息模板编辑
      */
-    public function seller_tpl_edit() {
+    public function seller_tpl_edit()
+    {
         if (!request()->isPost()) {
             $code = trim(input('param.code'));
             if (empty($code)) {
                 $this->error(lang('param_error'));
             }
             $condition = array();
-            $condition[] = array('storemt_code','=',$code);
+            $condition[] = array('storemt_code', '=', $code);
             $smtpl_info = model('storemsgtpl')->getStoremsgtplInfo($condition);
             View::assign('smtpl_info', $smtpl_info);
             $this->setAdminCurItem('seller_tpl_edit');
@@ -383,14 +397,15 @@ class Message extends AdminControl {
     /**
      * 商家消息模板更新站内信
      */
-    private function seller_tpl_update_message() {
+    private function seller_tpl_update_message()
+    {
         $message_content = trim(input('post.message_content'));
         if (empty($message_content)) {
             $this->error(lang('param_error'));
         }
         // 条件
         $condition = array();
-        $condition[] = array('storemt_code','=',trim(input('post.code')));
+        $condition[] = array('storemt_code', '=', trim(input('post.code')));
         // 数据
         $update = array();
         $update['storemt_message_switch'] = intval(input('post.message_switch'));
@@ -403,14 +418,15 @@ class Message extends AdminControl {
     /**
      * 商家消息模板更新短消息
      */
-    private function seller_tpl_update_short() {
+    private function seller_tpl_update_short()
+    {
         $short_content = trim(input('post.short_content'));
         if (empty($short_content)) {
             $this->error(lang('param_error'));
         }
         // 条件
         $condition = array();
-        $condition[] = array('storemt_code','=',trim(input('post.code')));
+        $condition[] = array('storemt_code', '=', trim(input('post.code')));
         // 数据
         $update = array();
         $update['storemt_short_switch'] = intval(input('post.short_switch'));
@@ -423,7 +439,8 @@ class Message extends AdminControl {
     /**
      * 商家消息模板更新邮件
      */
-    private function seller_tpl_update_mail() {
+    private function seller_tpl_update_mail()
+    {
         $mail_subject = trim(input('post.mail_subject'));
         $mail_content = trim(input('post.mail_content'));
         if ((empty($mail_subject) || empty($mail_content))) {
@@ -431,7 +448,7 @@ class Message extends AdminControl {
         }
         // 条件
         $condition = array();
-        $condition[] = array('storemt_code','=',trim(input('post.code')));
+        $condition[] = array('storemt_code', '=', trim(input('post.code')));
         // 数据
         $update = array();
         $update['storemt_mail_switch'] = intval(input('post.mail_switch'));
@@ -445,14 +462,15 @@ class Message extends AdminControl {
     /**
      * 商家消息模板更新邮件
      */
-    private function seller_tpl_update_weixin() {
+    private function seller_tpl_update_weixin()
+    {
         $weixin_code = trim(input('post.weixin_code'));
         if (empty($weixin_code)) {
             $this->error(lang('param_error'));
         }
         // 条件
         $condition = array();
-        $condition[] = array('storemt_code','=',trim(input('post.code')));
+        $condition[] = array('storemt_code', '=', trim(input('post.code')));
         // 数据
         $update = array();
         $update['storemt_weixin_switch'] = intval(input('post.weixin_switch'));
@@ -462,8 +480,9 @@ class Message extends AdminControl {
         $this->seller_tpl_update_showmessage($result);
     }
 
-    private function seller_tpl_update_showmessage($result) {
-        if ($result>=0) {
+    private function seller_tpl_update_showmessage($result)
+    {
+        if ($result >= 0) {
             $this->success(lang('ds_common_op_succ'), (string)url('Message/seller_tpl'));
         } else {
             $this->error(lang('ds_common_op_fail'));
@@ -473,7 +492,8 @@ class Message extends AdminControl {
     /**
      * 用户消息模板
      */
-    public function member_tpl() {
+    public function member_tpl()
+    {
         $mmtpl_list = model('membermsgtpl')->getMembermsgtplList(array());
         View::assign('mmtpl_list', $mmtpl_list);
         $this->setAdminCurItem('member_tpl');
@@ -483,14 +503,15 @@ class Message extends AdminControl {
     /**
      * 用户消息模板编辑
      */
-    public function member_tpl_edit() {
+    public function member_tpl_edit()
+    {
         if (!request()->isPost()) {
             $code = trim(input('param.code'));
             if (empty($code)) {
                 $this->error(lang('param_error'));
             }
             $condition = array();
-            $condition[] = array('membermt_code','=',$code);
+            $condition[] = array('membermt_code', '=', $code);
             $mmtpl_info = model('membermsgtpl')->getMembermsgtplInfo($condition);
             View::assign('mmtpl_info', $mmtpl_info);
             $this->setAdminCurItem('member_tpl_edit');
@@ -518,23 +539,25 @@ class Message extends AdminControl {
         }
     }
 
-    public function ali_tpl(){
+    public function ali_tpl()
+    {
         $mstpl_list = model('storemsgtpl')->getStoremsgtplList(array());
         $mmtpl_list = model('membermsgtpl')->getMembermsgtplList(array());
         $mailtemplates_model = model('mailtemplates');
-        $templates_list = $mailtemplates_model->getTplList(array(array('mailmt_code','<>','bind_email')));
-        View::assign('mstpl_list',$mstpl_list);
-        View::assign('mmtpl_list',$mmtpl_list);
-        View::assign('templates_list',$templates_list);
+        $templates_list = $mailtemplates_model->getTplList(array(array('mailmt_code', '<>', 'bind_email')));
+        View::assign('mstpl_list', $mstpl_list);
+        View::assign('mmtpl_list', $mmtpl_list);
+        View::assign('templates_list', $templates_list);
         $this->setAdminCurItem('message_ali_tpl');
         return View::fetch();
     }
 
-    public function ali_tpl_edit(){
-        $type=input('param.type');
-        $code=input('param.code');
-        $name=input('param.name');
-        switch($type){
+    public function ali_tpl_edit()
+    {
+        $type = input('param.type');
+        $code = input('param.code');
+        $name = input('param.name');
+        switch ($type) {
             case 'membermsgtpl':
                 if (!model('membermsgtpl')->editMembermsgtpl(array('membermt_code' => $name), array('ali_template_code' => $code))) {
                     ds_json_encode(10001, lang('ds_common_op_fail'));
@@ -561,40 +584,41 @@ class Message extends AdminControl {
         }
     }
 
-    public function ali_tpl_query() {
+    public function ali_tpl_query()
+    {
         $code = input('param.code');
 
         AlibabaCloud::accessKeyClient(config('ds_config.smscf_ali_id'), config('ds_config.smscf_ali_secret'))
-                ->regionId('cn-hangzhou')
-                ->asDefaultClient();
+            ->regionId('cn-hangzhou')
+            ->asDefaultClient();
 
         try {
             $result = AlibabaCloud::rpc()
-                    ->product('Dysmsapi')
-                    // ->scheme('https') // https | http
-                    ->version('2017-05-25')
-                    ->action('QuerySmsTemplate')
-                    ->method('POST')
-                    ->host('dysmsapi.aliyuncs.com')
-                    ->options([
-                        'query' => [
-                            'RegionId' => "cn-hangzhou",
-                            'TemplateCode' => $code,
-                        ],
-                    ])
-                    ->request();
-
+                ->product('Dysmsapi')
+                // ->scheme('https') // https | http
+                ->version('2017-05-25')
+                ->action('QuerySmsTemplate')
+                ->method('POST')
+                ->host('dysmsapi.aliyuncs.com')
+                ->options([
+                    'query' => [
+                        'RegionId' => "cn-hangzhou",
+                        'TemplateCode' => $code,
+                    ],
+                ])
+                ->request();
         } catch (\Exception $e) {
             ds_json_encode(10001, $e->getErrorMessage());
         }
-        ds_json_encode(10000, lang('ds_common_op_succ'),$result->toArray());
+        ds_json_encode(10000, lang('ds_common_op_succ'), $result->toArray());
     }
 
-    public function ten_tpl() {
+    public function ten_tpl()
+    {
         $mstpl_list = model('storemsgtpl')->getStoremsgtplList(array());
         $mmtpl_list = model('membermsgtpl')->getMembermsgtplList(array());
         $mailtemplates_model = model('mailtemplates');
-        $templates_list = $mailtemplates_model->getTplList(array(array('mailmt_code','<>', 'bind_email')));
+        $templates_list = $mailtemplates_model->getTplList(array(array('mailmt_code', '<>', 'bind_email')));
         View::assign('mstpl_list', $mstpl_list);
         View::assign('mmtpl_list', $mmtpl_list);
         View::assign('templates_list', $templates_list);
@@ -602,7 +626,8 @@ class Message extends AdminControl {
         return View::fetch();
     }
 
-    public function ten_tpl_edit() {
+    public function ten_tpl_edit()
+    {
         $type = input('param.type');
         $code = input('param.code');
         $name = input('param.name');
@@ -634,20 +659,21 @@ class Message extends AdminControl {
     }
 
     //接口
-    public function ten_tpl_query() {
+    public function ten_tpl_query()
+    {
         $code = input('param.code');
         // 短信应用 SDK AppID
         $appid = config('ds_config.smscf_ten_id'); // SDK AppID 以1400开头
         // 短信应用 SDK AppKey
         $appkey = config('ds_config.smscf_ten_secret');
         try {
-            $cred = new Credential($appid,$appkey);
+            $cred = new Credential($appid, $appkey);
             $httpProfile = new HttpProfile();
             $httpProfile->setEndpoint("sms.tencentcloudapi.com");
 
             $clientProfile = new ClientProfile();
             $clientProfile->setHttpProfile($httpProfile);
-            $client = new SmsClient($cred,"",$clientProfile);
+            $client = new SmsClient($cred, "", $clientProfile);
 
             $req = new DescribeSmsTemplateListRequest();
 
@@ -666,14 +692,15 @@ class Message extends AdminControl {
     /**
      * 商家消息模板更新站内信
      */
-    private function member_tpl_update_message() {
+    private function member_tpl_update_message()
+    {
         $message_content = trim(input('post.message_content'));
         if (empty($message_content)) {
             $this->error(lang('param_error'));
         }
         // 条件
         $condition = array();
-        $condition[] = array('membermt_code','=',trim(input('post.code')));
+        $condition[] = array('membermt_code', '=', trim(input('post.code')));
         // 数据
         $update = array();
         $update['membermt_message_switch'] = intval(input('post.message_switch'));
@@ -685,14 +712,15 @@ class Message extends AdminControl {
     /**
      * 商家消息模板更新短消息
      */
-    private function member_tpl_update_short() {
+    private function member_tpl_update_short()
+    {
         $short_content = trim(input('post.short_content'));
         if (empty($short_content)) {
             $this->error(lang('param_error'));
         }
         // 条件
         $condition = array();
-        $condition[] = array('membermt_code','=',trim(input('post.code')));
+        $condition[] = array('membermt_code', '=', trim(input('post.code')));
         // 数据
         $update = array();
         $update['membermt_short_switch'] = intval(input('post.short_switch'));
@@ -704,14 +732,15 @@ class Message extends AdminControl {
     /**
      * 商家消息模板更新邮件
      */
-    private function member_tpl_update_weixin() {
+    private function member_tpl_update_weixin()
+    {
         $weixin_code = trim(input('post.weixin_code'));
         if (empty($weixin_code)) {
             $this->error(lang('param_error'));
         }
         // 条件
         $condition = array();
-        $condition[] = array('membermt_code','=',trim(input('post.code')));
+        $condition[] = array('membermt_code', '=', trim(input('post.code')));
         // 数据
         $update = array();
         $update['membermt_weixin_switch'] = intval(input('post.weixin_switch'));
@@ -723,7 +752,8 @@ class Message extends AdminControl {
     /**
      * 商家消息模板更新邮件
      */
-    private function member_tpl_update_mail() {
+    private function member_tpl_update_mail()
+    {
         $mail_subject = trim(input('post.mail_subject'));
         $mail_content = trim(input('post.mail_content'));
         if ((empty($mail_subject) || empty($mail_content))) {
@@ -731,7 +761,7 @@ class Message extends AdminControl {
         }
         // 条件
         $condition = array();
-        $condition[] = array('membermt_code','=',trim(input('post.code')));
+        $condition[] = array('membermt_code', '=', trim(input('post.code')));
         // 数据
         $update = array();
         $update['membermt_mail_switch'] = intval(input('post.mail_switch'));
@@ -741,8 +771,9 @@ class Message extends AdminControl {
         $this->member_tpl_update_showmessage($result);
     }
 
-    private function member_tpl_update_showmessage($result) {
-        if ($result>=0) {
+    private function member_tpl_update_showmessage($result)
+    {
+        if ($result >= 0) {
             $this->success(lang('ds_common_op_succ'), (string)url('Message/member_tpl'));
         } else {
             $this->error(lang('ds_common_op_fail'));
@@ -752,7 +783,8 @@ class Message extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'email',
@@ -785,7 +817,7 @@ class Message extends AdminControl {
                 'url' => (string)url('Message/email_tpl')
             ),
         );
-        if(config('ds_config.smscf_type')=='ali'){
+        if (config('ds_config.smscf_type') == 'ali') {
             array_splice($menu_array, 2, 0, array(array(
                 'name' => 'message_ali_tpl',
                 'text' => lang('message_ali_tpl'),
@@ -824,5 +856,4 @@ class Message extends AdminControl {
 
         return $menu_array;
     }
-
 }

+ 3 - 3
app/admin/controller/Navigation.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Navigation extends AdminControl

+ 3 - 3
app/admin/controller/Notice.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Notice extends AdminControl

+ 3 - 3
app/admin/controller/Offpayarea.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Offpayarea extends AdminControl

+ 3 - 3
app/admin/controller/Operation.php

@@ -10,13 +10,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Operation extends AdminControl

+ 3 - 3
app/admin/controller/Order.php

@@ -7,13 +7,13 @@ use think\facade\Lang;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Order extends AdminControl

+ 3 - 3
app/admin/controller/Ownshop.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Ownshop extends AdminControl

+ 18 - 12
app/admin/controller/Payment.php

@@ -6,18 +6,20 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Payment extends AdminControl {
+class Payment extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
         Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/payment.lang.php');
     }
@@ -25,7 +27,8 @@ class Payment extends AdminControl {
     /**
      * 支付方式
      */
-    public function index() {
+    public function index()
+    {
         $payment_model = model('payment');
         //获取数据库中已安装的支付方式
         $install_payment_list = $payment_model->getPaymentList(array(array('payment_code', '<>', 'predeposit')));
@@ -62,7 +65,8 @@ class Payment extends AdminControl {
     /**
      * 安装支付方式
      */
-    function install() {
+    function install()
+    {
         $payment_code = input('param.payment_code');
         $payment_mod = model('payment');
         //如果是小程序支付、微信JS支付、微信H5支付、微信APP支付则必须先开启微信扫码支付
@@ -103,7 +107,8 @@ class Payment extends AdminControl {
     /**
      * 编辑
      */
-    public function edit() {
+    public function edit()
+    {
         $payment_model = model('payment');
         $payment_code = trim(input('param.payment_code'));
         $install_payment = $payment_model->getPaymentInfo(array('payment_code' => $payment_code));
@@ -160,7 +165,7 @@ class Payment extends AdminControl {
                         config($file_config, 'filesystem');
                         try {
                             validate(['image' => 'fileSize:' . ALLOW_IMG_SIZE . '|fileExt:pfx'])
-                                    ->check(['image' => $file]);
+                                ->check(['image' => $file]);
                             $file_name = \think\facade\Filesystem::putFile('', $file);
                             $cfg_value2 = $file_name;
                         } catch (\Exception $e) {
@@ -179,7 +184,8 @@ class Payment extends AdminControl {
     /**
      * 删除支付方式,卸载
      */
-    public function del() {
+    public function del()
+    {
         $payment_model = model('payment');
         $payment_code = trim(input('param.payment_code'));
         $condition = array();
@@ -195,7 +201,8 @@ class Payment extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index_pc',
@@ -215,5 +222,4 @@ class Payment extends AdminControl {
         );
         return $menu_array;
     }
-
 }

+ 3 - 3
app/admin/controller/Pointorder.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Pointorder extends AdminControl

+ 3 - 3
app/admin/controller/Pointprod.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Pointprod extends AdminControl

+ 3 - 3
app/admin/controller/Points.php

@@ -10,13 +10,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Points extends AdminControl

+ 138 - 116
app/admin/controller/Predeposit.php

@@ -1,57 +1,61 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Predeposit extends AdminControl {
+class Predeposit extends AdminControl
+{
     const EXPORT_SIZE = 1000;
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/predeposit.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/predeposit.lang.php');
     }
 
     /*
      * 充值明细
      */
 
-    public function pdrecharge_list() {
+    public function pdrecharge_list()
+    {
         $condition = array();
         $if_start_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_start_date'));
         $if_end_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_end_date'));
         $start_unixtime = $if_start_date ? strtotime(input('param.query_start_date')) : null;
         $end_unixtime = $if_end_date ? strtotime(input('param.query_end_date')) : null;
         if ($start_unixtime) {
-            $condition[]=array('pdr_addtime','>=', $start_unixtime);
+            $condition[] = array('pdr_addtime', '>=', $start_unixtime);
         }
         if ($end_unixtime) {
-            $end_unixtime=$end_unixtime+86399;
-            $condition[]=array('pdr_addtime','<=', $end_unixtime);
+            $end_unixtime = $end_unixtime + 86399;
+            $condition[] = array('pdr_addtime', '<=', $end_unixtime);
         }
         if (input('param.mname') != '') {
-            $condition[]=array('pdr_member_name','like', "%" . input('param.mname') . "%");
+            $condition[] = array('pdr_member_name', 'like', "%" . input('param.mname') . "%");
         }
         if (input('param.paystate_search') != '') {
-            $condition[]=array('pdr_payment_state','=',input('param.paystate_search'));
+            $condition[] = array('pdr_payment_state', '=', input('param.paystate_search'));
         }
         $predeposit_model = model('predeposit');
         $recharge_list = $predeposit_model->getPdRechargeList($condition, 20, '*', 'pdr_id desc');
         View::assign('recharge_list', $recharge_list);
         View::assign('show_page', $predeposit_model->page_info->render());
-        
+
         View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
-        
+
         $this->setAdminCurItem('pdrecharge_list');
         return View::fetch();
     }
@@ -59,7 +63,8 @@ class Predeposit extends AdminControl {
     /**
      * 充值编辑(更改成收到款)
      */
-    public function recharge_edit() {
+    public function recharge_edit()
+    {
         $id = intval(input('param.id'));
         if ($id <= 0) {
             $this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdrecharge_list');
@@ -67,8 +72,8 @@ class Predeposit extends AdminControl {
         //查询充值信息
         $predeposit_model = model('predeposit');
         $condition = array();
-        $condition[] = array('pdr_id','=',$id);
-        $condition[] = array('pdr_payment_state','=',0);
+        $condition[] = array('pdr_id', '=', $id);
+        $condition[] = array('pdr_payment_state', '=', 0);
         $info = $predeposit_model->getPdRechargeInfo($condition);
         if (empty($info)) {
             $this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdrecharge_list');
@@ -90,15 +95,15 @@ class Predeposit extends AdminControl {
         //取支付方式信息
         $payment_model = model('payment');
         $condition = array();
-        $condition[]=array('payment_code','=',input('post.payment_code'));
+        $condition[] = array('payment_code', '=', input('post.payment_code'));
         $payment_info = $payment_model->getPaymentOpenInfo($condition);
         if (!$payment_info || $payment_info['payment_code'] == 'offline' || $payment_info['payment_code'] == 'offline') {
             $this->error(lang('payment_index_sys_not_support'));
         }
 
         $condition = array();
-        $condition[] = array('pdr_sn','=',$info['pdr_sn']);
-        $condition[] = array('pdr_payment_state','=',0);
+        $condition[] = array('pdr_sn', '=', $info['pdr_sn']);
+        $condition[] = array('pdr_payment_state', '=', 0);
         $update = array();
         $update['pdr_payment_state'] = 1;
         $update['pdr_paymenttime'] = strtotime(input('post.payment_time'));
@@ -135,7 +140,8 @@ class Predeposit extends AdminControl {
     /**
      * 充值查看
      */
-    public function recharge_info() {
+    public function recharge_info()
+    {
         $id = intval(input('param.id'));
         if ($id <= 0) {
             $this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdrecharge_list');
@@ -143,7 +149,7 @@ class Predeposit extends AdminControl {
         //查询充值信息
         $predeposit_model = model('predeposit');
         $condition = array();
-        $condition[] = array('pdr_id','=',$id);
+        $condition[] = array('pdr_id', '=', $id);
         $info = $predeposit_model->getPdRechargeInfo($condition);
         if (empty($info)) {
             $this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdrecharge_list');
@@ -155,16 +161,17 @@ class Predeposit extends AdminControl {
     /**
      * 充值删除
      */
-    public function recharge_del() {
+    public function recharge_del()
+    {
         $pdr_id = input('param.pdr_id');
         $pdr_id_array = ds_delete_param($pdr_id);
-        if($pdr_id_array === FALSE){
+        if ($pdr_id_array === FALSE) {
             ds_json_encode('10001', lang('param_error'));
         }
         $predeposit_model = model('predeposit');
         $condition = array();
-        $condition[] = array('pdr_id','in', $pdr_id_array);
-        $condition[] = array('pdr_payment_state','=',0);
+        $condition[] = array('pdr_id', 'in', $pdr_id_array);
+        $condition[] = array('pdr_payment_state', '=', 0);
         $result = $predeposit_model->delPdRecharge($condition);
         if ($result) {
             ds_json_encode('10000', lang('ds_common_del_succ'));
@@ -179,7 +186,8 @@ class Predeposit extends AdminControl {
      * 预存款明细
      */
 
-    public function pdlog_list() {
+    public function pdlog_list()
+    {
         $condition = array();
         $stime = input('get.stime');
         $etime = input('get.etime');
@@ -188,27 +196,27 @@ class Predeposit extends AdminControl {
         $start_unixtime = $if_start_date ? strtotime($stime) : null;
         $end_unixtime = $if_end_date ? strtotime($etime) : null;
         if ($start_unixtime) {
-            $condition[]=array('lg_addtime','>=', $start_unixtime);
+            $condition[] = array('lg_addtime', '>=', $start_unixtime);
         }
         if ($end_unixtime) {
-            $end_unixtime=$end_unixtime+86399;
-            $condition[]=array('lg_addtime','<=', $end_unixtime);
+            $end_unixtime = $end_unixtime + 86399;
+            $condition[] = array('lg_addtime', '<=', $end_unixtime);
         }
         $mname = input('get.mname');
         if (!empty($mname)) {
-            $condition[] = array('lg_member_name','=',$mname);
+            $condition[] = array('lg_member_name', '=', $mname);
         }
         $aname = input('get.aname');
         if (!empty($aname)) {
-            $condition[] = array('lg_admin_name','=',$aname);
+            $condition[] = array('lg_admin_name', '=', $aname);
         }
         $predeposit_model = model('predeposit');
         $list_log = $predeposit_model->getPdLogList($condition, 10, '*', 'lg_id desc');
         View::assign('show_page', $predeposit_model->page_info->render());
         View::assign('list_log', $list_log);
-        
+
         View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
-        
+
         $this->setAdminCurItem('pdlog_list');
         return View::fetch();
     }
@@ -216,32 +224,34 @@ class Predeposit extends AdminControl {
     /*
      * 提现设置
      */
-    public function pdcash_set(){
+    public function pdcash_set()
+    {
         $config_model = model('config');
-        if(!request()->isPost()){
+        if (!request()->isPost()) {
             $list_setting = rkcache('config', true);
-            View::assign('list_setting',$list_setting);
+            View::assign('list_setting', $list_setting);
             $this->setAdminCurItem('pdcash_set');
             return View::fetch();
-        }else{
-            $update_array=array(
-                'member_withdraw_min'=>abs(round(input('post.member_withdraw_min'),2)),
-                'member_withdraw_max'=>abs(round(input('post.member_withdraw_max'),2)),
-                'member_withdraw_cycle'=>abs(intval(input('post.member_withdraw_cycle'))),
+        } else {
+            $update_array = array(
+                'member_withdraw_min' => abs(round(input('post.member_withdraw_min'), 2)),
+                'member_withdraw_max' => abs(round(input('post.member_withdraw_max'), 2)),
+                'member_withdraw_cycle' => abs(intval(input('post.member_withdraw_cycle'))),
             );
             $result = $config_model->editConfig($update_array);
             if ($result) {
-                $this->log(lang('ds_update').lang('admin_predeposit_cashset'),1);
+                $this->log(lang('ds_update') . lang('admin_predeposit_cashset'), 1);
                 $this->success(lang('ds_common_op_succ'), 'Predeposit/pdcash_set');
-            }else{
-                $this->log(lang('ds_update').lang('admin_predeposit_cashset'),0);
+            } else {
+                $this->log(lang('ds_update') . lang('admin_predeposit_cashset'), 0);
             }
         }
     }
     /*
      * 提现列表
      */
-    public function pdcash_list() {
+    public function pdcash_list()
+    {
         $condition = array();
         $stime = input('get.stime');
         $etime = input('get.etime');
@@ -250,31 +260,31 @@ class Predeposit extends AdminControl {
         $start_unixtime = $if_start_date ? strtotime($stime) : null;
         $end_unixtime = $if_end_date ? strtotime($etime) : null;
         if ($start_unixtime) {
-            $condition[]=array('pdc_addtime','>=', $start_unixtime);
+            $condition[] = array('pdc_addtime', '>=', $start_unixtime);
         }
         if ($end_unixtime) {
-            $end_unixtime=$end_unixtime+86399;
-            $condition[]=array('pdc_addtime','<=', $end_unixtime);
+            $end_unixtime = $end_unixtime + 86399;
+            $condition[] = array('pdc_addtime', '<=', $end_unixtime);
         }
         $mname = input('get.mname');
         if (!empty($mname)) {
-            $condition[]=array('pdc_member_name','like', "%" . $mname . "%");
+            $condition[] = array('pdc_member_name', 'like', "%" . $mname . "%");
         }
         $pdc_bank_user = input('get.pdc_bank_user');
         if (!empty($pdc_bank_user)) {
-            $condition[]=array('pdc_bank_user','like', "%" . $pdc_bank_user . "%");
+            $condition[] = array('pdc_bank_user', 'like', "%" . $pdc_bank_user . "%");
         }
         $paystate_search = input('get.paystate_search');
         if ($paystate_search != '') {
-            $condition[]=array('pdc_payment_state','=',$paystate_search);
+            $condition[] = array('pdc_payment_state', '=', $paystate_search);
         }
         $predeposit_model = model('predeposit');
         $predeposit_list = $predeposit_model->getPdcashList($condition, 20, '*', 'pdc_payment_state asc,pdc_id asc');
         View::assign('predeposit_list', $predeposit_list);
         View::assign('show_page', $predeposit_model->page_info->render());
-        
+
         View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
-        
+
         $this->setAdminCurItem('pdcash_list');
         return View::fetch('pdcash_list');
     }
@@ -282,15 +292,16 @@ class Predeposit extends AdminControl {
     /**
      * 删除提现记录
      */
-    public function pdcash_del() {
+    public function pdcash_del()
+    {
         $pdc_id = intval(input('param.pdc_id'));
         if ($pdc_id <= 0) {
-             ds_json_encode(10001, lang('param_error'));
+            ds_json_encode(10001, lang('param_error'));
         }
         $predeposit_model = model('predeposit');
         $condition = array();
-        $condition[] = array('pdc_id','=',$pdc_id);
-        $condition[] = array('pdc_payment_state','=',0);
+        $condition[] = array('pdc_id', '=', $pdc_id);
+        $condition[] = array('pdc_payment_state', '=', 0);
         $info = $predeposit_model->getPdcashInfo($condition);
         if (!$info) {
             ds_json_encode(10001, lang('admin_predeposit_parameter_error'));
@@ -323,15 +334,16 @@ class Predeposit extends AdminControl {
     /**
      * 更改提现为支付状态
      */
-    public function pdcash_pay() {
+    public function pdcash_pay()
+    {
         $id = intval(input('param.id'));
         if ($id <= 0) {
-            $this->error(lang('admin_predeposit_parameter_error'),'Predeposit/pdcash_list');
+            $this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdcash_list');
         }
         $predeposit_model = model('predeposit');
         $condition = array();
-        $condition[] = array('pdc_id','=',$id);
-        $condition[] = array('pdc_payment_state','=',0);
+        $condition[] = array('pdc_id', '=', $id);
+        $condition[] = array('pdc_payment_state', '=', 0);
         $info = $predeposit_model->getPdcashInfo($condition);
         if (!is_array($info) || count($info) < 0) {
             $this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdcash_list');
@@ -361,44 +373,44 @@ class Predeposit extends AdminControl {
             $data['order_sn'] = $info['pdc_sn'];
             $data['admin_name'] = $admininfo['admin_name'];
             $predeposit_model->changePd('cash_pay', $data);
-            if($info['pdc_bank_type']=='alipay'){//如果是支付宝且开启了支付宝提现
+            if ($info['pdc_bank_type'] == 'alipay') { //如果是支付宝且开启了支付宝提现
                 $logic_payment = model('payment', 'logic');
-                $payment_code='alipay';
+                $payment_code = 'alipay';
                 $result = $logic_payment->getPaymentInfo($payment_code);
                 if ($result['code']) {
                     $payment_info = $result['data'];
-                    if($payment_info['payment_config']['alipay_trade_transfer_state'] == 1){
+                    if ($payment_info['payment_config']['alipay_trade_transfer_state'] == 1) {
                         $payment_api = new $payment_code($payment_info);
                         $result = $payment_api->fund_transfer($info);
                         if (!$result['code']) {
                             throw new \think\Exception($result['msg'], 10006);
                         }
-                        $result = $predeposit_model->editPdcash(array('pdc_payment_code'=>$payment_code,'pdc_trade_sn'=>$result['data']['pdc_trade_sn']), array('pdc_id'=>$id));
+                        $result = $predeposit_model->editPdcash(array('pdc_payment_code' => $payment_code, 'pdc_trade_sn' => $result['data']['pdc_trade_sn']), array('pdc_id' => $id));
                         if (!$result) {
                             throw new \think\Exception(lang('admin_predeposit_cash_edit_fail'), 10006);
                         }
                     }
                 }
-            }elseif($info['pdc_bank_type']=='weixin'){//如果是微信且开启了微信提现
+            } elseif ($info['pdc_bank_type'] == 'weixin') { //如果是微信且开启了微信提现
                 $logic_payment = model('payment', 'logic');
-                $payment_code='wxpay_native';
+                $payment_code = 'wxpay_native';
                 $result = $logic_payment->getPaymentInfo($payment_code);
                 if ($result['code']) {
                     $payment_info = $result['data'];
-                    if($payment_info['payment_config']['wx_trade_transfer_state'] == 1){
+                    if ($payment_info['payment_config']['wx_trade_transfer_state'] == 1) {
                         $payment_api = new $payment_code($payment_info);
                         $result = $payment_api->fund_transfer($info);
                         if (!$result['code']) {
                             throw new \think\Exception($result['msg'], 10006);
                         }
-                        $result = $predeposit_model->editPdcash(array('pdc_payment_code'=>$payment_code,'pdc_trade_sn'=>$result['data']['pdc_trade_sn']), array('pdc_id'=>$id));
+                        $result = $predeposit_model->editPdcash(array('pdc_payment_code' => $payment_code, 'pdc_trade_sn' => $result['data']['pdc_trade_sn']), array('pdc_id' => $id));
                         if (!$result) {
                             throw new \think\Exception(lang('admin_predeposit_cash_edit_fail'), 10006);
                         }
                     }
                 }
             }
-            
+
             Db::commit();
             $this->log($log_msg, 1);
             dsLayerOpenSuccess(lang('admin_predeposit_cash_edit_success'));
@@ -412,14 +424,15 @@ class Predeposit extends AdminControl {
     /**
      * 查看提现信息
      */
-    public function pdcash_view() {
+    public function pdcash_view()
+    {
         $id = intval(input('param.id'));
         if ($id <= 0) {
             $this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdcash_list');
         }
         $predeposit_model = model('predeposit');
         $condition = array();
-        $condition[] = array('pdc_id','=',$id);
+        $condition[] = array('pdc_id', '=', $id);
         $info = $predeposit_model->getPdcashInfo($condition);
         if (!is_array($info) || count($info) < 0) {
             $this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdcash_list');
@@ -432,15 +445,16 @@ class Predeposit extends AdminControl {
      * 调节预存款
      */
 
-    public function pd_add() {
+    public function pd_add()
+    {
         if (!(request()->isPost())) {
             $member_id = intval(input('get.member_id'));
-            if($member_id>0){
+            if ($member_id > 0) {
                 $condition = array();
-                $condition[] = array('member_id','=',$member_id);
+                $condition[] = array('member_id', '=', $member_id);
                 $member = model('member')->getMemberInfo($condition);
-                if(!empty($member)){
-                    View::assign('member_info',$member);
+                if (!empty($member)) {
+                    View::assign('member_info', $member);
                 }
             }
             return View::fetch();
@@ -532,7 +546,8 @@ class Predeposit extends AdminControl {
     }
 
     //取得会员信息
-    public function checkmember() {
+    public function checkmember()
+    {
         $name = input('post.name');
         if (!$name) {
             exit(json_encode(array('id' => 0)));
@@ -546,35 +561,36 @@ class Predeposit extends AdminControl {
             exit(json_encode(array('id' => 0)));
         }
     }
-    
-    
-    
+
+
+
 
     /**
      * 导出预存款充值记录
      *
      */
-    public function export_step1() {
+    public function export_step1()
+    {
         $condition = array();
         $if_start_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_start_date'));
         $if_end_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_end_date'));
         $start_unixtime = $if_start_date ? strtotime(input('param.query_start_date')) : null;
         $end_unixtime = $if_end_date ? strtotime(input('param.query_end_date')) : null;
         if ($start_unixtime) {
-            $condition[] = array('pdr_addtime','>=', $start_unixtime);
+            $condition[] = array('pdr_addtime', '>=', $start_unixtime);
         }
         if ($end_unixtime) {
-            $end_unixtime=$end_unixtime+86399;
-            $condition[] = array('pdr_addtime','<=', $end_unixtime);
+            $end_unixtime = $end_unixtime + 86399;
+            $condition[] = array('pdr_addtime', '<=', $end_unixtime);
         }
         if (input('param.mname') != '') {
-            $condition[]=array('pdr_member_name','like', "%" . input('param.mname') . "%");
+            $condition[] = array('pdr_member_name', 'like', "%" . input('param.mname') . "%");
         }
         if (input('param.paystate_search') != '') {
-            $condition[]=array('pdr_payment_state','=',input('param.paystate_search'));
+            $condition[] = array('pdr_payment_state', '=', input('param.paystate_search'));
         }
-        
-        
+
+
         $predeposit_model = model('predeposit');
         if (!is_numeric(input('param.page'))) {
             $count = $predeposit_model->getPdRechargeCount($condition);
@@ -613,8 +629,9 @@ class Predeposit extends AdminControl {
      *
      * @param array $data
      */
-    private function createExcel($data = array()) {
-        Lang::load(base_path() .'admin/lang/'.config('lang.default_lang').'/export.lang.php');
+    private function createExcel($data = array())
+    {
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/export.lang.php');
         $excel_obj = new \excel\Excel();
         $excel_data = array();
         //设置样式
@@ -654,12 +671,13 @@ class Predeposit extends AdminControl {
         $excel_obj->generateXML($excel_obj->charset(lang('exp_yc_yckcz'), CHARSET) . input('param.page') . '-' . date('Y-m-d-H', TIMESTAMP));
     }
 
-    
+
     /**
      * 导出预存款提现记录
      *
      */
-    public function export_cash_step1() {
+    public function export_cash_step1()
+    {
         $condition = array();
         $stime = input('get.stime');
         $etime = input('get.etime');
@@ -668,23 +686,23 @@ class Predeposit extends AdminControl {
         $start_unixtime = $if_start_date ? strtotime($stime) : null;
         $end_unixtime = $if_end_date ? strtotime($etime) : null;
         if ($start_unixtime) {
-            $condition[] = array('pdc_addtime','>=', $start_unixtime);
+            $condition[] = array('pdc_addtime', '>=', $start_unixtime);
         }
         if ($end_unixtime) {
-            $end_unixtime=$end_unixtime+86399;
-            $condition[] = array('pdc_addtime','<=', $end_unixtime);
+            $end_unixtime = $end_unixtime + 86399;
+            $condition[] = array('pdc_addtime', '<=', $end_unixtime);
         }
         $mname = input('get.mname');
         if (!empty($mname)) {
-            $condition[]=array('pdc_member_name','like', "%" . $mname . "%");
+            $condition[] = array('pdc_member_name', 'like', "%" . $mname . "%");
         }
         $pdc_bank_user = input('get.pdc_bank_user');
         if (!empty($pdc_bank_user)) {
-            $condition[]=array('pdc_bank_user','like', "%" . $pdc_bank_user . "%");
+            $condition[] = array('pdc_bank_user', 'like', "%" . $pdc_bank_user . "%");
         }
         $paystate_search = input('get.paystate_search');
         if ($paystate_search != '') {
-            $condition[]=array('pdc_payment_state','=',$paystate_search);
+            $condition[] = array('pdc_payment_state', '=', $paystate_search);
         }
 
         $predeposit_model = Model('predeposit');
@@ -726,8 +744,9 @@ class Predeposit extends AdminControl {
      *
      * @param array $data
      */
-    private function createCashExcel($data = array()) {
-        Lang::load(base_path() .'admin/lang/'.config('lang.default_lang').'/export.lang.php');
+    private function createCashExcel($data = array())
+    {
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/export.lang.php');
         $excel_obj = new \excel\Excel();
         $excel_data = array();
         //设置样式
@@ -758,7 +777,8 @@ class Predeposit extends AdminControl {
     /**
      * 预存款明细信息导出
      */
-    public function export_mx_step1() {
+    public function export_mx_step1()
+    {
         $condition = array();
         $stime = input('get.stime');
         $etime = input('get.etime');
@@ -767,22 +787,22 @@ class Predeposit extends AdminControl {
         $start_unixtime = $if_start_date ? strtotime($stime) : null;
         $end_unixtime = $if_end_date ? strtotime($etime) : null;
         if ($start_unixtime) {
-            $condition[] = array('lg_addtime','>=',$start_unixtime);
+            $condition[] = array('lg_addtime', '>=', $start_unixtime);
         }
         if ($end_unixtime) {
-            $end_unixtime=$end_unixtime+86399;
-            $condition[] = array('lg_addtime','<=',$end_unixtime);
+            $end_unixtime = $end_unixtime + 86399;
+            $condition[] = array('lg_addtime', '<=', $end_unixtime);
         }
         $mname = input('get.mname');
         if (!empty($mname)) {
-            $condition[] = array('lg_member_name','=',$mname);
+            $condition[] = array('lg_member_name', '=', $mname);
         }
         $aname = input('get.aname');
         if (!empty($aname)) {
-            $condition[] = array('lg_admin_name','=',$aname);
+            $condition[] = array('lg_admin_name', '=', $aname);
         }
-        
-        
+
+
         $predeposit_model = model('predeposit');
         if (!is_numeric(input('param.page'))) {
             $count = $predeposit_model->getPdLogCount($condition);
@@ -813,8 +833,9 @@ class Predeposit extends AdminControl {
      *
      * @param array $data
      */
-    private function createmxExcel($data = array()) {
-        Lang::load(base_path() .'admin/lang/'.config('lang.default_lang').'/export.lang.php');
+    private function createmxExcel($data = array())
+    {
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/export.lang.php');
         $excel_obj = new \excel\Excel();
         $excel_data = array();
         //设置样式
@@ -849,12 +870,13 @@ class Predeposit extends AdminControl {
         $excel_obj->addWorksheet($excel_obj->charset(lang('exp_mx_rz'), CHARSET));
         $excel_obj->generateXML($excel_obj->charset(lang('exp_mx_rz'), CHARSET) . input('param.page') . '-' . date('Y-m-d-H', TIMESTAMP));
     }
-    
-    
+
+
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'pdrecharge_list',
@@ -879,7 +901,7 @@ class Predeposit extends AdminControl {
             array(
                 'name' => 'pd_add',
                 'text' => lang('pd_add'),
-                'url' => "javascript:dsLayerOpen('".(string)url('Predeposit/pd_add')."','".lang('pd_add')."')"
+                'url' => "javascript:dsLayerOpen('" . (string)url('Predeposit/pd_add') . "','" . lang('pd_add') . "')"
             ),
         );
         return $menu_array;

+ 3 - 3
app/admin/controller/Promotionbargain.php

@@ -11,13 +11,13 @@ use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 

+ 3 - 3
app/admin/controller/Promotionbooth.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Promotionbooth extends AdminControl

+ 3 - 3
app/admin/controller/Promotionbundling.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Promotionbundling extends AdminControl

+ 3 - 3
app/admin/controller/Promotionmansong.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Promotionmansong extends AdminControl

+ 3 - 3
app/admin/controller/Promotionmgdiscount.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Promotionmgdiscount extends AdminControl

+ 3 - 3
app/admin/controller/Promotionpintuan.php

@@ -10,13 +10,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Promotionpintuan extends AdminControl

+ 3 - 3
app/admin/controller/Promotionpresell.php

@@ -11,13 +11,13 @@ use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Promotionpresell extends AdminControl

+ 3 - 3
app/admin/controller/Promotionwholesale.php

@@ -10,13 +10,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Promotionwholesale extends AdminControl

+ 3 - 3
app/admin/controller/Promotionxianshi.php

@@ -11,13 +11,13 @@ use think\facade\Lang;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Promotionxianshi extends AdminControl

+ 3 - 3
app/admin/controller/Rechargecard.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Rechargecard extends AdminControl

+ 60 - 61
app/admin/controller/Refund.php

@@ -1,17 +1,18 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Refund extends AdminControl
@@ -20,7 +21,7 @@ class Refund extends AdminControl
     public function initialize()
     {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/refund.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/refund.lang.php');
         //向模板页面输出退款退货状态
         $this->getRefundStateArray();
     }
@@ -53,27 +54,27 @@ class Refund extends AdminControl
     {
         $refundreturn_model = model('refundreturn');
         $condition = array();
-        $condition[]=array('refund_type','=',1);
-        $condition[]=array('refund_state','=','2'); //状态:1为处理中,2为待管理员处理,3为已完成
+        $condition[] = array('refund_type', '=', 1);
+        $condition[] = array('refund_state', '=', '2'); //状态:1为处理中,2为待管理员处理,3为已完成
 
         $keyword_type = array('order_sn', 'refund_sn', 'store_name', 'buyer_name', 'goods_name');
         $key = input('get.key');
         $type = input('get.type');
         if (trim($key) != '' && in_array($type, $keyword_type)) {
-            $condition[]=array($type,'like', '%' . $key . '%');
+            $condition[] = array($type, 'like', '%' . $key . '%');
         }
         $add_time_from = input('get.add_time_from');
         $add_time_to = input('get.add_time_to');
         if (trim($add_time_from) != '') {
             $add_time_from = strtotime(trim($add_time_from));
             if ($add_time_from !== false) {
-                $condition[] = array('add_time','>=', $add_time_from);
+                $condition[] = array('add_time', '>=', $add_time_from);
             }
         }
         if (trim($add_time_to) != '') {
-            $add_time_to = strtotime(trim($add_time_to))+86399;
+            $add_time_to = strtotime(trim($add_time_to)) + 86399;
             if ($add_time_to !== false) {
-                $condition[] = array('add_time','<=', $add_time_to);
+                $condition[] = array('add_time', '<=', $add_time_to);
             }
         }
         $refund_list = $refundreturn_model->getRefundList($condition, 10);
@@ -90,25 +91,25 @@ class Refund extends AdminControl
     {
         $refundreturn_model = model('refundreturn');
         $condition = array();
-        $condition[]=array('refund_type','=',1);
+        $condition[] = array('refund_type', '=', 1);
         $keyword_type = array('order_sn', 'refund_sn', 'store_name', 'buyer_name', 'goods_name');
         $key = input('get.key');
         $type = input('get.type');
         if (trim($key) != '' && in_array($type, $keyword_type)) {
-            $condition[]=array($type,'like', '%' . $key . '%');
+            $condition[] = array($type, 'like', '%' . $key . '%');
         }
         $add_time_from = input('get.add_time_from');
         $add_time_to = input('get.add_time_to');
         if (trim($add_time_from) != '') {
             $add_time_from = strtotime(trim($add_time_from));
             if ($add_time_from !== false) {
-                $condition[] = array('add_time','>=', $add_time_from);
+                $condition[] = array('add_time', '>=', $add_time_from);
             }
         }
         if (trim($add_time_to) != '') {
-            $add_time_to = strtotime(trim($add_time_to))+86399;
+            $add_time_to = strtotime(trim($add_time_to)) + 86399;
             if ($add_time_to !== false) {
-                $condition[] = array('add_time','<=', $add_time_to);
+                $condition[] = array('add_time', '<=', $add_time_to);
             }
         }
         $refund_list = $refundreturn_model->getRefundList($condition, 10);
@@ -126,21 +127,21 @@ class Refund extends AdminControl
     {
         $refundreturn_model = model('refundreturn');
         $condition = array();
-        $condition[] = array('refund_id','=',intval(input('param.refund_id')));
-        $refund_list = $refundreturn_model->getRefundList(array_merge($condition,array(array('refund_type','=',1))));
+        $condition[] = array('refund_id', '=', intval(input('param.refund_id')));
+        $refund_list = $refundreturn_model->getRefundList(array_merge($condition, array(array('refund_type', '=', 1))));
         $refund = $refund_list[0];
         //查询交易凭证
         $order_model = model('order');
         $order = $order_model->getOrderInfo(array('order_id' => $refund['order_id']));
         if (request()->isPost()) {
-            if(!in_array(input('post.refund_state'),[3,4])){
-              $this->error(lang('refund_state_null'));
+            if (!in_array(input('post.refund_state'), [3, 4])) {
+                $this->error(lang('refund_state_null'));
             }
             $check = request()->checkToken('__token__');
-            if(false === $check) {
+            if (false === $check) {
                 $this->error('invalid token');
             }
-            if ($refund['refund_state'] != '2') {//检查状态,防止页面刷新不及时造成数据错误
+            if ($refund['refund_state'] != '2') { //检查状态,防止页面刷新不及时造成数据错误
                 $this->error(lang('ds_common_save_fail'));
             }
             $order_id = $refund['order_id'];
@@ -149,10 +150,10 @@ class Refund extends AdminControl
             $refund_array['refund_state'] = '4'; //状态:1为处理中,2为待管理员处理,3为已完成
             $refund_array['admin_message'] = input('post.admin_message');
             if (input('post.refund_state') == '3') {
-                $trade_no=input('param.trade_no');
-                if($trade_no && $trade_no!=$order['trade_no']){
-                    $order_model->editOrder(array('trade_no'=>$trade_no), array(
-                    'order_id' => $order['order_id']
+                $trade_no = input('param.trade_no');
+                if ($trade_no && $trade_no != $order['trade_no']) {
+                    $order_model->editOrder(array('trade_no' => $trade_no), array(
+                        'order_id' => $order['order_id']
                     ));
                     //添加订单日志
                     $data = array();
@@ -165,21 +166,21 @@ class Refund extends AdminControl
                 }
                 $refund_array['refund_state'] = '3';
                 $res = $refundreturn_model->editOrderRefund($refund);
-                $state=$res['code'];
-                if(!$state){
+                $state = $res['code'];
+                if (!$state) {
                     $this->error($res['msg']);
                 }
-            }else{
-                if($refund['order_lock'] == '2'){
+            } else {
+                if ($refund['order_lock'] == '2') {
                     $state = $refundreturn_model->editOrderUnlock($order_id); //订单解锁
-                }else{
+                } else {
                     $state = true;
                 }
                 //自提点订单解锁
-                $chain_order_model=model('chain_order');
+                $chain_order_model = model('chain_order');
                 $chain_order_model->editChainOrderUnlock($order_id);
             }
-            
+
             if ($state) {
                 $refundreturn_model->editRefundreturn($condition, $refund_array);
 
@@ -194,13 +195,13 @@ class Refund extends AdminControl
                 $param['ten_param'] = array(
                     $refund['refund_sn']
                 );
-                $param['param'] = array_merge($param['ali_param'],array(
-                    'refund_url' => HOME_SITE_URL .'/memberrefund/view?refund_id='.$refund['refund_id'],
+                $param['param'] = array_merge($param['ali_param'], array(
+                    'refund_url' => HOME_SITE_URL . '/memberrefund/view?refund_id=' . $refund['refund_id'],
                 ));
                 //微信模板消息
                 $param['weixin_param'] = array(
-                    'url' => config('ds_config.h5_site_url').'/pages/member/refund/RefundView?refund_id='.$refund['refund_id'],
-                    'data'=>array(
+                    'url' => config('ds_config.h5_site_url') . '/pages/member/refund/RefundView?refund_id=' . $refund['refund_id'],
+                    'data' => array(
                         "keyword1" => array(
                             "value" => $refund['order_sn'],
                             "color" => "#333"
@@ -211,12 +212,11 @@ class Refund extends AdminControl
                         )
                     ),
                 );
-                model('cron')->addCron(array('cron_exetime'=>TIMESTAMP,'cron_type'=>'sendMemberMsg','cron_value'=>serialize($param)));
-              
+                model('cron')->addCron(array('cron_exetime' => TIMESTAMP, 'cron_type' => 'sendMemberMsg', 'cron_value' => serialize($param)));
+
                 $this->log('退款确认,退款编号' . $refund['refund_sn']);
                 dsLayerOpenSuccess(lang('ds_common_save_succ'));
-            }
-            else {
+            } else {
                 $this->error(lang('ds_common_save_fail'));
             }
         }
@@ -238,8 +238,8 @@ class Refund extends AdminControl
     {
         $refundreturn_model = model('refundreturn');
         $condition = array();
-        $condition[]=array('refund_id','=',intval(input('param.refund_id')));
-        $condition[] =array('refund_type','=',1);
+        $condition[] = array('refund_id', '=', intval(input('param.refund_id')));
+        $condition[] = array('refund_type', '=', 1);
         $refund_list = $refundreturn_model->getRefundList($condition);
         $refund = $refund_list[0];
         View::assign('refund', $refund);
@@ -282,8 +282,7 @@ class Refund extends AdminControl
             if ($state) {
                 $this->log('新增退款退货原因,编号' . $state);
                 dsLayerOpenSuccess(lang('ds_common_save_succ'));
-            }
-            else {
+            } else {
                 $this->error(lang('ds_common_save_fail'));
             }
         }
@@ -299,7 +298,7 @@ class Refund extends AdminControl
         $refundreturn_model = model('refundreturn');
         $condition = array();
         $reason_id = intval(input('param.reason_id'));
-        $condition[] = array('reason_id','=',$reason_id);
+        $condition[] = array('reason_id', '=', $reason_id);
         $reason_list = $refundreturn_model->getReasonList($condition);
         $reason = $reason_list[$reason_id];
         if (request()->post()) {
@@ -311,8 +310,7 @@ class Refund extends AdminControl
             if ($state) {
                 $this->log('编辑退款退货原因,编号' . $reason_id);
                 dsLayerOpenSuccess(lang('ds_common_save_succ'));
-            }
-            else {
+            } else {
                 $this->error(lang('ds_common_save_fail'));
             }
         }
@@ -329,16 +327,15 @@ class Refund extends AdminControl
         $refundreturn_model = model('refundreturn');
         $reason_id = input('param.reason_id');
         $reason_id_array = ds_delete_param($reason_id);
-        if($reason_id_array === FALSE){
+        if ($reason_id_array === FALSE) {
             ds_json_encode('10001', lang('param_error'));
         }
-        $condition = array(array('reason_id','in', $reason_id_array));
+        $condition = array(array('reason_id', 'in', $reason_id_array));
         $state = $refundreturn_model->delReason($condition);
         if ($state) {
             $this->log('删除退款退货原因,编号' . $reason_id);
             ds_json_encode('10000', lang('ds_common_del_succ'));
-        }
-        else {
+        } else {
             ds_json_encode('10001', lang('ds_common_del_fail'));
         }
     }
@@ -347,7 +344,8 @@ class Refund extends AdminControl
      * 导出
      *
      */
-    public function export_step1() {
+    public function export_step1()
+    {
 
         $refundreturn_model = model('refundreturn');
         $condition = array();
@@ -356,20 +354,20 @@ class Refund extends AdminControl
         $key = input('get.key');
         $type = input('get.type');
         if (trim($key) != '' && in_array($type, $keyword_type)) {
-            $condition[]=array($type,'like', '%' . $key . '%');
+            $condition[] = array($type, 'like', '%' . $key . '%');
         }
         $add_time_from = input('get.add_time_from');
         $add_time_to = input('get.add_time_to');
         if (trim($add_time_from) != '') {
             $add_time_from = strtotime(trim($add_time_from));
             if ($add_time_from !== false) {
-                $condition[] = array('add_time','>=', $add_time_from);
+                $condition[] = array('add_time', '>=', $add_time_from);
             }
         }
         if (trim($add_time_to) != '') {
-            $add_time_to = strtotime(trim($add_time_to))+86399;
+            $add_time_to = strtotime(trim($add_time_to)) + 86399;
             if ($add_time_to !== false) {
-                $condition[] = array('add_time','<=', $add_time_to);
+                $condition[] = array('add_time', '<=', $add_time_to);
             }
         }
         if (!is_numeric(input('param.page'))) {
@@ -385,13 +383,13 @@ class Refund extends AdminControl
                 View::assign('export_list', $export_list);
                 return View::fetch('/public/excel');
             } else { //如果数量小,直接下载
-                $data = $refundreturn_model->getRefundList(array_merge($condition,array(array('refund_type','=',1))), '', '*', 'refund_id desc', self::EXPORT_SIZE);
+                $data = $refundreturn_model->getRefundList(array_merge($condition, array(array('refund_type', '=', 1))), '', '*', 'refund_id desc', self::EXPORT_SIZE);
                 $this->createExcel($data);
             }
         } else { //下载
             $limit1 = (input('param.page') - 1) * self::EXPORT_SIZE;
             $limit2 = self::EXPORT_SIZE;
-            $data = $refundreturn_model->getRefundList(array_merge($condition,array(array('refund_type','=',1))), $limit2, '*', 'refund_id desc');
+            $data = $refundreturn_model->getRefundList(array_merge($condition, array(array('refund_type', '=', 1))), $limit2, '*', 'refund_id desc');
             $this->createExcel($data);
         }
     }
@@ -401,8 +399,9 @@ class Refund extends AdminControl
      *
      * @param array $data
      */
-    private function createExcel($data = array()) {
-        Lang::load(base_path() .'admin/lang/'.config('lang.default_lang').'/export.lang.php');
+    private function createExcel($data = array())
+    {
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/export.lang.php');
         $excel_obj = new \excel\Excel();
         $excel_data = array();
         //设置样式
@@ -449,7 +448,7 @@ class Refund extends AdminControl
         );
         if (request()->action() == 'reason') {
             $menu_array[] = [
-                'name' => 'add_reason', 'text' => lang('add_reason'), 'url' =>"javascript:dsLayerOpen('".(string)url('Refund/add_reason')."','".lang('add_reason')."')"
+                'name' => 'add_reason', 'text' => lang('add_reason'), 'url' => "javascript:dsLayerOpen('" . (string)url('Refund/add_reason') . "','" . lang('add_reason') . "')"
             ];
         }
         return $menu_array;

+ 3 - 3
app/admin/controller/Region.php

@@ -11,13 +11,13 @@ use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Region extends AdminControl

+ 67 - 57
app/admin/controller/Returnmanage.php

@@ -1,30 +1,34 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Returnmanage extends AdminControl {
+class Returnmanage extends AdminControl
+{
 
     const EXPORT_SIZE = 1000;
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/returnmanage.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/returnmanage.lang.php');
         //向模板页面输出退款退货状态
         $this->getRefundStateArray();
     }
 
-    function getRefundStateArray($type = 'all') {
+    function getRefundStateArray($type = 'all')
+    {
         $state_array = array(
             '1' => lang('refund_state_confirm'),
             '2' => lang('refund_state_yes'),
@@ -35,7 +39,7 @@ class Returnmanage extends AdminControl {
         $admin_array = array(
             '1' => lang('admin_state_1'),
             '2' => lang('admin_state_2'),
-            '3' => lang('admin_state_3'), 
+            '3' => lang('admin_state_3'),
             '4' => lang('refund_state_no')
         ); //确认状态:1为买家或卖家处理中,2为待平台管理员处理,3为退款退货已完成
         View::assign('admin_array', $admin_array);
@@ -53,38 +57,39 @@ class Returnmanage extends AdminControl {
     /**
      * 待处理列表
      */
-    public function return_manage() {
+    public function return_manage()
+    {
         $refundreturn_model = model('refundreturn');
         $condition = array();
-        $condition[]=array('refund_state','=','2'); //状态:1为处理中,2为待管理员处理,3为已完成
+        $condition[] = array('refund_state', '=', '2'); //状态:1为处理中,2为待管理员处理,3为已完成
         $keyword_type = array('order_sn', 'refund_sn', 'store_name', 'buyer_name', 'goods_name');
 
         $key = input('get.key');
         $type = input('get.type');
         if (trim($key) != '' && in_array($type, $keyword_type)) {
-            $condition[]=array($type,'like', '%' . $key . '%');
+            $condition[] = array($type, 'like', '%' . $key . '%');
         }
         $add_time_from = input('get.add_time_from');
         $add_time_to = input('get.add_time_to');
         if (trim($add_time_from) != '') {
             $add_time_from = strtotime(trim($add_time_from));
             if ($add_time_from !== false) {
-                $condition[] = array('add_time','>=', $add_time_from);
+                $condition[] = array('add_time', '>=', $add_time_from);
             }
         }
         if (trim($add_time_to) != '') {
-            $add_time_to = strtotime(trim($add_time_to))+86399;
+            $add_time_to = strtotime(trim($add_time_to)) + 86399;
             if ($add_time_to !== false) {
-                $condition[] = array('add_time','<=', $add_time_to);
+                $condition[] = array('add_time', '<=', $add_time_to);
             }
         }
         $return_list = $refundreturn_model->getReturnList($condition, 10);
 
         View::assign('return_list', $return_list);
         View::assign('show_page', $refundreturn_model->page_info->render());
-        
+
         View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
-        
+
         $this->setAdminCurItem('return_manage');
         return View::fetch('return_manage');
     }
@@ -92,7 +97,8 @@ class Returnmanage extends AdminControl {
     /**
      * 所有记录
      */
-    public function return_all() {
+    public function return_all()
+    {
         $refundreturn_model = model('refundreturn');
         $condition = array();
 
@@ -100,26 +106,26 @@ class Returnmanage extends AdminControl {
         $key = input('get.key');
         $type = input('get.type');
         if (trim($key) != '' && in_array($type, $keyword_type)) {
-            $condition[]=array($type,'like', '%' . $key . '%');
+            $condition[] = array($type, 'like', '%' . $key . '%');
         }
         $add_time_from = input('get.add_time_from');
         $add_time_to = input('get.add_time_to');
         if (trim($add_time_from) != '') {
             $add_time_from = strtotime(trim($add_time_from));
             if ($add_time_from !== false) {
-                $condition[] = array('add_time','>=', $add_time_from);
+                $condition[] = array('add_time', '>=', $add_time_from);
             }
         }
         if (trim($add_time_to) != '') {
-            $add_time_to = strtotime(trim($add_time_to))+86399;
+            $add_time_to = strtotime(trim($add_time_to)) + 86399;
             if ($add_time_to !== false) {
-                $condition[] = array('add_time','<=', $add_time_to);
+                $condition[] = array('add_time', '<=', $add_time_to);
             }
         }
         $return_list = $refundreturn_model->getReturnList($condition, 10);
         View::assign('return_list', $return_list);
         View::assign('show_page', $refundreturn_model->page_info->render());
-        
+
         View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
         $this->setAdminCurItem('return_all');
         return View::fetch('return_all');
@@ -129,26 +135,27 @@ class Returnmanage extends AdminControl {
      * 退货处理页
      *
      */
-    public function edit() {
+    public function edit()
+    {
         $refundreturn_model = model('refundreturn');
         $condition = array();
-        $condition[] = array('refund_id','=',intval(input('param.refund_id')));
+        $condition[] = array('refund_id', '=', intval(input('param.refund_id')));
         $return = $refundreturn_model->getRefundreturnInfo($condition);
-        if(empty($return)){
+        if (empty($return)) {
             $this->error(lang('param_error'));
         }
         //查询交易凭证
         $order_model = model('order');
         $order = $order_model->getOrderInfo(array('order_id' => $return['order_id']));
         if (request()->isPost()) {
-            if(!in_array(input('post.refund_state'),[3,4])){
-              $this->error(lang('refund_state_null'));
+            if (!in_array(input('post.refund_state'), [3, 4])) {
+                $this->error(lang('refund_state_null'));
             }
             $check = request()->checkToken('__token__');
-            if(false === $check) {
+            if (false === $check) {
                 $this->error('invalid token');
             }
-            if ($return['refund_state'] != '2') {//检查状态,防止页面刷新不及时造成数据错误
+            if ($return['refund_state'] != '2') { //检查状态,防止页面刷新不及时造成数据错误
                 $this->error(lang('ds_common_save_fail'));
             }
             $order_id = $return['order_id'];
@@ -157,10 +164,10 @@ class Returnmanage extends AdminControl {
             $refund_array['refund_state'] = '4'; //状态:1为处理中,2为待管理员处理,3为已完成
             $refund_array['admin_message'] = input('post.admin_message');
             if (input('post.refund_state') == '3') {
-                $trade_no=input('param.trade_no');
-                if($trade_no && $trade_no!=$order['trade_no']){
-                    $order_model->editOrder(array('trade_no'=>$trade_no), array(
-                    'order_id' => $order['order_id']
+                $trade_no = input('param.trade_no');
+                if ($trade_no && $trade_no != $order['trade_no']) {
+                    $order_model->editOrder(array('trade_no' => $trade_no), array(
+                        'order_id' => $order['order_id']
                     ));
                     //添加订单日志
                     $data = array();
@@ -173,18 +180,18 @@ class Returnmanage extends AdminControl {
                 }
                 $refund_array['refund_state'] = '3';
                 $res = $refundreturn_model->editOrderRefund($return);
-                $state=$res['code'];
-                if(!$state){
+                $state = $res['code'];
+                if (!$state) {
                     $this->error($res['msg']);
                 }
-            }else{
-                if($return['order_lock'] == '2'){
+            } else {
+                if ($return['order_lock'] == '2') {
                     $state = $refundreturn_model->editOrderUnlock($order_id); //订单解锁
-                }else{
+                } else {
                     $state = true;
                 }
             }
-            
+
             if ($state) {
                 $refundreturn_model->editRefundreturn($condition, $refund_array);
                 $this->log('退货确认,退货编号' . $return['refund_sn']);
@@ -200,13 +207,13 @@ class Returnmanage extends AdminControl {
                 $param['ten_param'] = array(
                     $return['refund_sn']
                 );
-                $param['param'] = array_merge($param['ali_param'],array(
-                    'refund_url' => HOME_SITE_URL .'/memberreturn/view?return_id='.$return['refund_id'],
+                $param['param'] = array_merge($param['ali_param'], array(
+                    'refund_url' => HOME_SITE_URL . '/memberreturn/view?return_id=' . $return['refund_id'],
                 ));
                 //微信模板消息
                 $param['weixin_param'] = array(
-                    'url' => config('ds_config.h5_site_url').'/pages/member/return/ReturnView?refund_id='.$return['refund_id'],
-                    'data'=>array(
+                    'url' => config('ds_config.h5_site_url') . '/pages/member/return/ReturnView?refund_id=' . $return['refund_id'],
+                    'data' => array(
                         "keyword1" => array(
                             "value" => $return['order_sn'],
                             "color" => "#333"
@@ -217,7 +224,7 @@ class Returnmanage extends AdminControl {
                         )
                     ),
                 );
-                model('cron')->addCron(array('cron_exetime'=>TIMESTAMP,'cron_type'=>'sendMemberMsg','cron_value'=>serialize($param)));
+                model('cron')->addCron(array('cron_exetime' => TIMESTAMP, 'cron_type' => 'sendMemberMsg', 'cron_value' => serialize($param)));
 
                 dsLayerOpenSuccess(lang('ds_common_save_succ'));
             } else {
@@ -238,12 +245,13 @@ class Returnmanage extends AdminControl {
      * 退货记录查看页
      *
      */
-    public function view() {
+    public function view()
+    {
         $refundreturn_model = model('refundreturn');
         $condition = array();
-        $condition[] = array('refund_id','=',intval(input('param.refund_id')));
+        $condition[] = array('refund_id', '=', intval(input('param.refund_id')));
         $return = $refundreturn_model->getRefundreturnInfo($condition);
-        if(empty($return)){
+        if (empty($return)) {
             $this->error(lang('param_error'));
         }
         View::assign('return', $return);
@@ -260,7 +268,8 @@ class Returnmanage extends AdminControl {
      * 导出
      *
      */
-    public function export_step1() {
+    public function export_step1()
+    {
 
         $refundreturn_model = model('refundreturn');
         $condition = array();
@@ -269,20 +278,20 @@ class Returnmanage extends AdminControl {
         $key = input('get.key');
         $type = input('get.type');
         if (trim($key) != '' && in_array($type, $keyword_type)) {
-            $condition[]=array($type,'like', '%' . $key . '%');
+            $condition[] = array($type, 'like', '%' . $key . '%');
         }
         $add_time_from = input('get.add_time_from');
         $add_time_to = input('get.add_time_to');
         if (trim($add_time_from) != '') {
             $add_time_from = strtotime(trim($add_time_from));
             if ($add_time_from !== false) {
-                $condition[] = array('add_time','>=', $add_time_from);
+                $condition[] = array('add_time', '>=', $add_time_from);
             }
         }
         if (trim($add_time_to) != '') {
-            $add_time_to = strtotime(trim($add_time_to))+86399;
+            $add_time_to = strtotime(trim($add_time_to)) + 86399;
             if ($add_time_to !== false) {
-                $condition[] = array('add_time','<=', $add_time_to);
+                $condition[] = array('add_time', '<=', $add_time_to);
             }
         }
         if (!is_numeric(input('param.page'))) {
@@ -314,8 +323,9 @@ class Returnmanage extends AdminControl {
      *
      * @param array $data
      */
-    private function createExcel($data = array()) {
-        Lang::load(base_path() .'admin/lang/'.config('lang.default_lang').'/export.lang.php');
+    private function createExcel($data = array())
+    {
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/export.lang.php');
         $excel_obj = new \excel\Excel();
         $excel_data = array();
         //设置样式
@@ -351,7 +361,8 @@ class Returnmanage extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'return_manage',
@@ -364,12 +375,11 @@ class Returnmanage extends AdminControl {
                 'url' => (string)url('Returnmanage/return_all')
             ),
         );
-        if(request()->action() == 'edit') {
+        if (request()->action() == 'edit') {
             $menu_array[] = array(
                 'name' => 'edit', 'text' => lang('ds_verify'), 'url' => 'javascript:void(0)',
             );
         }
         return $menu_array;
     }
-
 }

+ 15 - 11
app/admin/controller/Seo.php

@@ -1,27 +1,32 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 use think\facade\Db;
+
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Seo extends AdminControl {
+class Seo extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/seo.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/seo.lang.php');
     }
 
-    function index() {
+    function index()
+    {
         if (!request()->isPost()) {
             //读取SEO信息
             $list = Db::name('seo')->select()->toArray();
@@ -30,12 +35,12 @@ class Seo extends AdminControl {
                 $seo[$value['seo_type']] = $value;
             }
             View::assign('seo', $seo);
-//            $category = model('goodsclass')->getGoodsclassForCacheModel();
-//            View::assign('category', $category);
+            //            $category = model('goodsclass')->getGoodsclassForCacheModel();
+            //            View::assign('category', $category);
             return View::fetch('index');
         } else {
             $update = array();
-            $seo = input('post.SEO/a');#获取数组
+            $seo = input('post.SEO/a'); #获取数组
             if (is_array($seo)) {
                 foreach ($seo as $key => $value) {
                     Db::name('seo')->where(array('seo_type' => $key))->update($value);
@@ -45,5 +50,4 @@ class Seo extends AdminControl {
             }
         }
     }
-
 }

+ 3 - 3
app/admin/controller/Snsmalbum.php

@@ -7,13 +7,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Snsmalbum extends AdminControl

+ 3 - 3
app/admin/controller/Snsmember.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Snsmember extends AdminControl

+ 38 - 30
app/admin/controller/Spec.php

@@ -5,51 +5,56 @@
  */
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Spec extends AdminControl {
+class Spec extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/spec.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/spec.lang.php');
     }
 
-    public function index() {
-        
-         /**
+    public function index()
+    {
+
+        /**
          * 查询条件
          */
         $where = array();
-        
+
         $sp_name = trim(input('param.sp_name'));
         if ($sp_name != '') {
-            $where[]=array('sp_name','like', '%' . $sp_name . '%');
+            $where[] = array('sp_name', 'like', '%' . $sp_name . '%');
         }
         $gc_name = trim(input('param.gc_name'));
         if ($gc_name != '') {
-            $where[]=array('gc_name','like', '%' . $gc_name . '%');
+            $where[] = array('gc_name', 'like', '%' . $gc_name . '%');
         }
-        
+
         $spec_model = model('spec');
-        $spec_list	= $spec_model->getSpecList($where, 10);
+        $spec_list    = $spec_model->getSpecList($where, 10);
         View::assign('spec_list', $spec_list);
         View::assign('show_page', $spec_model->page_info->render());
         $this->setAdminCurItem('index');
         return View::fetch();
     }
 
-    public function spec_add() {
+    public function spec_add()
+    {
         if (!(request()->isPost())) {
             $spec = [
                 'gc_id' => 0,
@@ -70,8 +75,8 @@ class Spec extends AdminControl {
                 $this->error($spec_validate->getError());
             }
 
-            $spec_model= model('spec');
-            $result=$spec_model->addSpec($data);
+            $spec_model = model('spec');
+            $result = $spec_model->addSpec($data);
             if ($result) {
                 dsLayerOpenSuccess(lang('ds_common_op_succ'));
             } else {
@@ -80,15 +85,16 @@ class Spec extends AdminControl {
         }
     }
 
-    public function spec_edit() {
+    public function spec_edit()
+    {
         //注:pathinfo地址参数不能通过get方法获取,查看“获取PARAM变量”
         $sp_id = input('param.sp_id');
         if (empty($sp_id)) {
             $this->error(lang('param_error'));
         }
         if (!request()->isPost()) {
-            $spec_model= model('spec');
-            $spec=$spec_model->getSpecInfo($sp_id);
+            $spec_model = model('spec');
+            $spec = $spec_model->getSpecInfo($sp_id);
             View::assign('spec', $spec);
             $gc_list = model('goodsclass')->getGoodsclassListByParentId(0);
             View::assign('gc_list', $gc_list);
@@ -105,11 +111,11 @@ class Spec extends AdminControl {
                 $this->error($spec_validate->getError());
             }
 
-            $spec_model= model('spec');
-            $condition=array();
-            $condition[] = array('sp_id','=',$sp_id);
-            $result=$spec_model->editSpec($data, $condition);
-            if ($result>=0) {
+            $spec_model = model('spec');
+            $condition = array();
+            $condition[] = array('sp_id', '=', $sp_id);
+            $result = $spec_model->editSpec($data, $condition);
+            if ($result >= 0) {
                 dsLayerOpenSuccess(lang('ds_common_op_succ'));
             } else {
                 $this->error(lang('ds_common_op_fail'));
@@ -117,15 +123,16 @@ class Spec extends AdminControl {
         }
     }
 
-    public function spec_drop() {
+    public function spec_drop()
+    {
         //注:pathinfo地址参数不能通过get方法获取,查看“获取PARAM变量”
         $sp_id = intval(input('param.sp_id'));
         // sp_id 值为1 不能删除,用于处理前台显示图片的规格
-        if ($sp_id<=1) {
+        if ($sp_id <= 1) {
             $this->error(lang('param_error'));
         }
         $spec_model = model('spec');
-        $result=$spec_model->delSpec(array('sp_id' => $sp_id));
+        $result = $spec_model->delSpec(array('sp_id' => $sp_id));
         if ($result) {
             ds_json_encode(10000, lang('ds_common_del_succ'));
         } else {
@@ -135,7 +142,8 @@ class Spec extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -145,7 +153,7 @@ class Spec extends AdminControl {
             array(
                 'name' => 'spec_add',
                 'text' => lang('ds_new'),
-                'url' => "javascript:dsLayerOpen('".(string)url('Spec/spec_add')."','".lang('ds_new')."')"
+                'url' => "javascript:dsLayerOpen('" . (string)url('Spec/spec_add') . "','" . lang('ds_new') . "')"
             ),
         );
         return $menu_array;

+ 3 - 3
app/admin/controller/Stataftersale.php

@@ -10,13 +10,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Stataftersale extends AdminControl

+ 3 - 3
app/admin/controller/Statgeneral.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Statgeneral extends AdminControl

+ 3 - 3
app/admin/controller/Statgoods.php

@@ -11,13 +11,13 @@ use think\facade\Lang;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Statgoods extends AdminControl

+ 3 - 3
app/admin/controller/Statindustry.php

@@ -7,13 +7,13 @@ use think\facade\Lang;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Statindustry extends AdminControl

+ 3 - 3
app/admin/controller/Statmarketing.php

@@ -11,13 +11,13 @@ use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Statmarketing extends AdminControl

+ 3 - 3
app/admin/controller/Statmember.php

@@ -12,13 +12,13 @@ use think\facade\Lang;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Statmember extends AdminControl

+ 3 - 3
app/admin/controller/Statstore.php

@@ -12,13 +12,13 @@ use excel\Excel;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Statstore extends AdminControl

+ 3 - 3
app/admin/controller/Stattrade.php

@@ -11,13 +11,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Stattrade extends AdminControl

+ 120 - 88
app/admin/controller/Store.php

@@ -7,18 +7,20 @@ use think\facade\Lang;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Store extends AdminControl {
+class Store extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
         Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/store.lang.php');
     }
@@ -26,7 +28,8 @@ class Store extends AdminControl {
     /**
      * 店铺
      */
-    public function store() {
+    public function store()
+    {
         $store_model = model('store');
 
         $owner_and_name = input('get.owner_and_name');
@@ -84,7 +87,8 @@ class Store extends AdminControl {
         return View::fetch('store');
     }
 
-    private function _get_store_state_array() {
+    private function _get_store_state_array()
+    {
         return array(
             'open' => lang('ds_open'),
             'close' => lang('ds_close'),
@@ -96,7 +100,8 @@ class Store extends AdminControl {
     /**
      * 店铺编辑
      */
-    public function store_edit() {
+    public function store_edit()
+    {
         $store_id = input('param.store_id');
         $store_model = model('store');
         //取店铺信息
@@ -196,7 +201,8 @@ class Store extends AdminControl {
     /**
      * 编辑保存注册信息
      */
-    public function edit_save_joinin() {
+    public function edit_save_joinin()
+    {
         if (request()->isPost()) {
             $member_id = input('post.member_id');
             if ($member_id <= 0) {
@@ -251,7 +257,8 @@ class Store extends AdminControl {
         }
     }
 
-    private function upload_image($file) {
+    private function upload_image($file)
+    {
 
         //上传文件保存路径
         $pic_name = '';
@@ -274,7 +281,8 @@ class Store extends AdminControl {
     /**
      * 店铺经营类目管理
      */
-    public function store_bind_class() {
+    public function store_bind_class()
+    {
 
         $store_id = intval(input('param.store_id'));
 
@@ -306,7 +314,8 @@ class Store extends AdminControl {
     /**
      * 添加经营类目
      */
-    public function store_bind_class_add() {
+    public function store_bind_class_add()
+    {
         $store_id = intval(input('post.store_id'));
         $commis_rate = intval(input('post.commis_rate'));
         if ($commis_rate < 0 || $commis_rate > 100) {
@@ -347,7 +356,8 @@ class Store extends AdminControl {
     /**
      * 删除经营类目
      */
-    public function store_bind_class_del() {
+    public function store_bind_class_del()
+    {
         $bid = intval(input('param.bid'));
 
 
@@ -378,7 +388,8 @@ class Store extends AdminControl {
         }
     }
 
-    public function store_bind_class_update() {
+    public function store_bind_class_update()
+    {
         $bid = intval(input('param.id'));
         if ($bid <= 0) {
             echo json_encode(array('result' => FALSE, 'message' => lang('param_error')));
@@ -407,7 +418,8 @@ class Store extends AdminControl {
     /**
      * 店铺 待审核列表
      */
-    public function store_joinin() {
+    public function store_joinin()
+    {
         $condition = array();
         //店铺列表
         if (input('param.owner_and_name')) {
@@ -445,7 +457,8 @@ class Store extends AdminControl {
     /**
      * 经营类目申请列表
      */
-    public function store_bind_class_applay_list() {
+    public function store_bind_class_applay_list()
+    {
         $condition = array();
         // 不显示自营店铺绑定的类目
         $state = input('param.state');
@@ -498,7 +511,8 @@ class Store extends AdminControl {
     /**
      * 审核经营类目申请
      */
-    public function store_bind_class_applay_check() {
+    public function store_bind_class_applay_check()
+    {
         $storebindclass_model = model('storebindclass');
         $condition = array();
         $condition[] = array('storebindclass_id', '=', intval(input('param.bid')));
@@ -515,7 +529,8 @@ class Store extends AdminControl {
     /**
      * 删除经营类目申请
      */
-    public function store_bind_class_applay_del() {
+    public function store_bind_class_applay_del()
+    {
         $storebindclass_model = model('storebindclass');
         $condition = array();
         $condition[] = array('storebindclass_id', '=', intval(input('param.bid')));
@@ -528,7 +543,8 @@ class Store extends AdminControl {
         }
     }
 
-    private function get_store_joinin_state() {
+    private function get_store_joinin_state()
+    {
         $joinin_state_array = array(
             STORE_JOIN_STATE_NEW => lang('store_join_state_new'),
             STORE_JOIN_STATE_PAY => lang('store_join_state_pay'),
@@ -543,7 +559,8 @@ class Store extends AdminControl {
     /**
      * 店铺续签申请列表
      */
-    public function reopen_list() {
+    public function reopen_list()
+    {
         $condition = array();
         $store_id = input('get.store_id');
         if (intval($store_id)) {
@@ -572,7 +589,8 @@ class Store extends AdminControl {
     /**
      * 审核店铺续签申请
      */
-    public function reopen_check() {
+    public function reopen_check()
+    {
         if (intval(input('param.storereopen_id')) <= 0)
             exit();
         $storereopen_model = model('storereopen');
@@ -603,7 +621,8 @@ class Store extends AdminControl {
     /**
      * 删除店铺续签申请
      */
-    public function reopen_del() {
+    public function reopen_del()
+    {
         $storereopen_model = model('storereopen');
         $condition = array();
         $condition[] = array('storereopen_id', '=', intval(input('param.storereopen_id')));
@@ -627,7 +646,8 @@ class Store extends AdminControl {
     /**
      * 审核详细页
      */
-    public function store_joinin_detail() {
+    public function store_joinin_detail()
+    {
         $storejoinin_model = model('storejoinin');
         $member_id = input('param.member_id');
         $joinin_detail = $storejoinin_model->getOneStorejoinin(array('member_id' => $member_id));
@@ -653,7 +673,8 @@ class Store extends AdminControl {
     /**
      * 审核
      */
-    public function store_joinin_verify() {
+    public function store_joinin_verify()
+    {
         $storejoinin_model = model('storejoinin');
         $joinin_detail = $storejoinin_model->getOneStorejoinin(array('member_id' => input('param.member_id')));
 
@@ -670,7 +691,8 @@ class Store extends AdminControl {
         }
     }
 
-    private function store_joinin_verify_pass($joinin_detail) {
+    private function store_joinin_verify_pass($joinin_detail)
+    {
         $param = array();
         $param['joinin_state'] = input('post.verify_type') === 'pass' ? STORE_JOIN_STATE_VERIFY_SUCCESS : STORE_JOIN_STATE_VERIFY_FAIL;
         $param['joinin_message'] = input('post.joinin_message');
@@ -687,7 +709,8 @@ class Store extends AdminControl {
         }
     }
 
-    private function store_joinin_verify_open($joinin_detail) {
+    private function store_joinin_verify_open($joinin_detail)
+    {
         $storejoinin_model = model('storejoinin');
         $store_model = model('store');
 
@@ -698,9 +721,9 @@ class Store extends AdminControl {
 
         if (input('post.verify_type') === 'pass') {
             Db::startTrans();
-            try{
-                $store_model->setStoreOpen($joinin_detail,$param);
-            }catch(\Exception $e) {
+            try {
+                $store_model->setStoreOpen($joinin_detail, $param);
+            } catch (\Exception $e) {
                 Db::rollback();
                 $this->error($e->getMessage());
             }
@@ -708,41 +731,42 @@ class Store extends AdminControl {
             dsLayerOpenSuccess(lang('ds_common_op_succ'));
         } else {
             Db::startTrans();
-            try{
+            try {
                 $predeposit_model = model('predeposit');
-                if($joinin_detail['rcb_amount']>0){
-                            $data_pd = array();
-                            $data_pd['member_id'] = $joinin_detail['member_id'];
-                            $data_pd['member_name'] = $joinin_detail['member_name'];
-                            $data_pd['amount'] = $joinin_detail['rcb_amount'];
-                            $data_pd['order_sn'] = $joinin_detail['pay_sn'];
-                            $predeposit_model->changeRcb('storejoinin_cancel', $data_pd);
+                if ($joinin_detail['rcb_amount'] > 0) {
+                    $data_pd = array();
+                    $data_pd['member_id'] = $joinin_detail['member_id'];
+                    $data_pd['member_name'] = $joinin_detail['member_name'];
+                    $data_pd['amount'] = $joinin_detail['rcb_amount'];
+                    $data_pd['order_sn'] = $joinin_detail['pay_sn'];
+                    $predeposit_model->changeRcb('storejoinin_cancel', $data_pd);
                 }
-                if($joinin_detail['pd_amount']>0){
-                            $data_pd = array();
-                            $data_pd['member_id'] = $joinin_detail['member_id'];
-                            $data_pd['member_name'] = $joinin_detail['member_name'];
-                            $data_pd['amount'] = $joinin_detail['pd_amount'];
-                            $data_pd['order_sn'] = $joinin_detail['pay_sn'];
-                            $predeposit_model->changePd('storejoinin_cancel', $data_pd);
+                if ($joinin_detail['pd_amount'] > 0) {
+                    $data_pd = array();
+                    $data_pd['member_id'] = $joinin_detail['member_id'];
+                    $data_pd['member_name'] = $joinin_detail['member_name'];
+                    $data_pd['amount'] = $joinin_detail['pd_amount'];
+                    $data_pd['order_sn'] = $joinin_detail['pay_sn'];
+                    $predeposit_model->changePd('storejoinin_cancel', $data_pd);
                 }
-            //改变店铺状态
-            $storejoinin_model->editStorejoinin($param, array('member_id' => input('param.member_id')));
-            }catch(\Exception $e) {
-                    Db::rollback();
-                    $this->error($e->getMessage());
+                //改变店铺状态
+                $storejoinin_model->editStorejoinin($param, array('member_id' => input('param.member_id')));
+            } catch (\Exception $e) {
+                Db::rollback();
+                $this->error($e->getMessage());
             }
             Db::commit();
 
             dsLayerOpenSuccess(lang('ds_common_op_succ'));
-//            $this->error(lang('store_open_reject'));
+            //            $this->error(lang('store_open_reject'));
         }
     }
 
     /**
      * 提醒续费
      */
-    public function remind_renewal() {
+    public function remind_renewal()
+    {
         $store_id = intval(input('param.store_id'));
         $store_info = model('store')->getStoreInfoByID($store_id);
         if (!empty($store_info) && $store_info['store_endtime'] < (TIMESTAMP + 864000) && cookie('remindRenewal' . $store_id) == null) {
@@ -766,7 +790,7 @@ class Store extends AdminControl {
                     )
                 ),
             );
-            model('cron')->addCron(array('cron_exetime'=>TIMESTAMP,'cron_type'=>'sendStoremsg','cron_value'=>serialize($param)));
+            model('cron')->addCron(array('cron_exetime' => TIMESTAMP, 'cron_type' => 'sendStoremsg', 'cron_value' => serialize($param)));
 
             cookie('remindRenewal' . $store_id, 1, 86400 * 10);  // 十天
             $this->success(lang('ds_common_op_succ'));
@@ -808,7 +832,8 @@ class Store extends AdminControl {
      */
 
     //删除店铺操作 
-    public function del_join() {
+    public function del_join()
+    {
         $member_id = (int) input('param.member_id');
         $store_joinin = model('storejoinin');
         $condition = array(
@@ -819,7 +844,6 @@ class Store extends AdminControl {
             $this->error(lang('ds_common_op_fail'), get_referer());
         }
         if ($mm['joinin_state'] == '20') {
-            
         }
         $store_name = $mm['store_name'];
         $store_model = model('store');
@@ -828,29 +852,29 @@ class Store extends AdminControl {
             $this->error(lang('store_exist'), get_referer());
         }
         Db::startTrans();
-        try{
+        try {
             $predeposit_model = model('predeposit');
-            if($mm['rcb_amount']>0){
-                        $data_pd = array();
-                        $data_pd['member_id'] = $mm['member_id'];
-                        $data_pd['member_name'] = $mm['member_name'];
-                        $data_pd['amount'] = $mm['rcb_amount'];
-                        $data_pd['order_sn'] = $mm['pay_sn'];
-                        $predeposit_model->changeRcb('storejoinin_cancel', $data_pd);
+            if ($mm['rcb_amount'] > 0) {
+                $data_pd = array();
+                $data_pd['member_id'] = $mm['member_id'];
+                $data_pd['member_name'] = $mm['member_name'];
+                $data_pd['amount'] = $mm['rcb_amount'];
+                $data_pd['order_sn'] = $mm['pay_sn'];
+                $predeposit_model->changeRcb('storejoinin_cancel', $data_pd);
             }
-            if($mm['pd_amount']>0){
-                        $data_pd = array();
-                        $data_pd['member_id'] = $mm['member_id'];
-                        $data_pd['member_name'] = $mm['member_name'];
-                        $data_pd['amount'] = $mm['pd_amount'];
-                        $data_pd['order_sn'] = $mm['pay_sn'];
-                        $predeposit_model->changePd('storejoinin_cancel', $data_pd);
+            if ($mm['pd_amount'] > 0) {
+                $data_pd = array();
+                $data_pd['member_id'] = $mm['member_id'];
+                $data_pd['member_name'] = $mm['member_name'];
+                $data_pd['amount'] = $mm['pd_amount'];
+                $data_pd['order_sn'] = $mm['pay_sn'];
+                $predeposit_model->changePd('storejoinin_cancel', $data_pd);
             }
-        // 完全删除店铺入驻
-        $store_joinin->delStorejoinin($condition);
-        }catch(\Exception $e) {
-                Db::rollback();
-                $this->error($e->getMessage());
+            // 完全删除店铺入驻
+            $store_joinin->delStorejoinin($condition);
+        } catch (\Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
         }
         Db::commit();
 
@@ -858,7 +882,8 @@ class Store extends AdminControl {
         ds_json_encode('10000', lang('ds_common_del_succ'));
     }
 
-    public function newshop_add() {
+    public function newshop_add()
+    {
         if (!request()->isPost()) {
             return View::fetch('store_newshop_add');
         } else {
@@ -942,15 +967,17 @@ class Store extends AdminControl {
         }
     }
 
-    public function check_seller_name() {
+    public function check_seller_name()
+    {
         echo json_encode($this->checkSellerName(input('param.seller_name')));
         exit;
     }
 
-    private function checkSellerName($sellerName) {
+    private function checkSellerName($sellerName)
+    {
         // 判断store_joinin是否存在记录
         $count = (int) model('storejoinin')->getStorejoininCount(array(
-                    'seller_name' => $sellerName,
+            'seller_name' => $sellerName,
         ));
         if ($count > 0)
             return false;
@@ -964,28 +991,31 @@ class Store extends AdminControl {
         return TRUE;
     }
 
-    public function check_member_name() {
+    public function check_member_name()
+    {
         echo json_encode($this->checkMemberName(input('param.member_name')));
         exit;
     }
 
-    private function checkMemberName($member_name) {
+    private function checkMemberName($member_name)
+    {
         // 判断store_joinin是否存在记录
         $count = (int) model('storejoinin')->getStorejoininCount(array(
-                    'member_name' => $member_name,
+            'member_name' => $member_name,
         ));
         if ($count > 0)
             return false;
 
         return !model('member')->getMemberCount(array(
-                    'member_name' => $member_name,
+            'member_name' => $member_name,
         ));
     }
 
     /**
      * 验证店铺名称是否存在
      */
-    public function ckeck_store_name() {
+    public function ckeck_store_name()
+    {
         $where = array();
         $where[] = array('store_name', '=', input('param.store_name'));
         $where[] = array('store_id', '<>', input('param.store_id'));
@@ -1000,7 +1030,8 @@ class Store extends AdminControl {
     /**
      * 验证店铺名称是否存在
      */
-    private function ckeckStoreName($store_name) {
+    private function ckeckStoreName($store_name)
+    {
         $condition = array();
         $condition[] = array('store_name', '=', $store_name);
         $store_info = model('store')->getStoreInfo($condition);
@@ -1012,10 +1043,11 @@ class Store extends AdminControl {
     }
 
     //ajax操作
-    public function ajax() {
+    public function ajax()
+    {
         $store_model = model('store');
         switch (input('param.branch')) {
-            /**
+                /**
              * 品牌名称
              */
             case 'store_sort':
@@ -1033,7 +1065,8 @@ class Store extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'store',
@@ -1064,5 +1097,4 @@ class Store extends AdminControl {
         }
         return $menu_array;
     }
-
 }

+ 34 - 26
app/admin/controller/Storeclass.php

@@ -5,30 +5,34 @@
  */
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Storeclass extends AdminControl {
+class Storeclass extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/storeclass.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/storeclass.lang.php');
     }
 
     /**
      * 店铺分类
      */
-    public function store_class() {
+    public function store_class()
+    {
         $storeclass_model = model('storeclass');
 
         $store_class_list = $storeclass_model->getStoreclassList(array(), 20);
@@ -41,7 +45,8 @@ class Storeclass extends AdminControl {
     /**
      * 商品分类添加
      */
-    public function store_class_add() {
+    public function store_class_add()
+    {
         $storeclass_model = model('storeclass');
 
         if (!request()->isPost()) {
@@ -54,7 +59,7 @@ class Storeclass extends AdminControl {
             $insert_array['storeclass_sort'] = intval(input('post.storeclass_sort'));
 
             $storeclass_validate = ds_validate('storeclass');
-            if (!$storeclass_validate->scene('store_class_add')->check($insert_array)){
+            if (!$storeclass_validate->scene('store_class_add')->check($insert_array)) {
                 $this->error($storeclass_validate->getError());
             }
 
@@ -62,7 +67,7 @@ class Storeclass extends AdminControl {
             $result = $storeclass_model->addStoreclass($insert_array);
             if ($result) {
                 $this->log(lang('ds_add') . lang('store_class') . '[' . input('post.storeclass_name') . ']', 1);
-                dsLayerOpenSuccess(lang('ds_common_save_succ'),(string)url('Storeclass/store_class'));
+                dsLayerOpenSuccess(lang('ds_common_save_succ'), (string)url('Storeclass/store_class'));
             } else {
                 $this->error(lang('ds_common_save_fail'));
             }
@@ -72,7 +77,8 @@ class Storeclass extends AdminControl {
     /**
      * 编辑
      */
-    public function store_class_edit() {
+    public function store_class_edit()
+    {
         $storeclass_model = model('storeclass');
 
         if (!request()->isPost()) {
@@ -91,14 +97,14 @@ class Storeclass extends AdminControl {
             $update_array['storeclass_sort'] = intval(input('post.storeclass_sort'));
 
             $storeclass_validate = ds_validate('storeclass');
-            if (!$storeclass_validate->scene('store_class_edit')->check($update_array)){
+            if (!$storeclass_validate->scene('store_class_edit')->check($update_array)) {
                 $this->error($storeclass_validate->getError());
             }
 
             $result = $storeclass_model->editStoreclass($update_array, array('storeclass_id' => intval(input('param.storeclass_id'))));
-            if ($result>=0) {
+            if ($result >= 0) {
                 $this->log(lang('ds_edit') . lang('store_class') . '[' . input('post.storeclass_name') . ']', 1);
-                dsLayerOpenSuccess(lang('ds_common_save_succ'),(string)url('Storeclass/store_class'));
+                dsLayerOpenSuccess(lang('ds_common_save_succ'), (string)url('Storeclass/store_class'));
             } else {
                 $this->error(lang('ds_common_save_fail'));
             }
@@ -108,7 +114,8 @@ class Storeclass extends AdminControl {
     /**
      * 删除分类
      */
-    public function store_class_del() {
+    public function store_class_del()
+    {
         $storeclass_model = model('storeclass');
         $storeclass_id = input('param.storeclass_id');
         $storeclass_id_array = ds_delete_param($storeclass_id);
@@ -116,7 +123,7 @@ class Storeclass extends AdminControl {
             ds_json_encode('10001', lang('param_error'));
         }
         $condition = array();
-        $condition[]=array('storeclass_id','in', $storeclass_id_array);
+        $condition[] = array('storeclass_id', 'in', $storeclass_id_array);
 
         $result = $storeclass_model->delStoreclass($condition);
         if ($result) {
@@ -128,16 +135,17 @@ class Storeclass extends AdminControl {
     /**
      * ajax操作
      */
-    public function ajax() {
+    public function ajax()
+    {
         $storeclass_model = model('storeclass');
         $update_array = array();
         $branch = input('param.branch');
         switch ($branch) {
-            //分类:验证是否有重复的名称
+                //分类:验证是否有重复的名称
             case 'store_class_name':
                 $condition = array();
-                $condition[]=array('storeclass_name','=',input('get.value'));
-                $condition[]=array('storeclass_id','<>', intval(input('param.id')));
+                $condition[] = array('storeclass_name', '=', input('get.value'));
+                $condition[] = array('storeclass_id', '<>', intval(input('param.id')));
                 $class_list = $storeclass_model->getStoreclassList($condition);
                 if (empty($class_list)) {
                     $update_array['storeclass_name'] = input('get.value');
@@ -147,15 +155,15 @@ class Storeclass extends AdminControl {
                     $return = 'false';
                 }
                 break;
-            //分类: 排序 显示 设置
+                //分类: 排序 显示 设置
             case 'store_class_sort':
                 $update_array['storeclass_sort'] = intval(input('get.value'));
                 $result = $storeclass_model->editStoreclass($update_array, array('storeclass_id' => intval(input('param.id'))));
                 $return = 'true';
                 break;
-            //分类:添加、修改操作中 检测类别名称是否有重复
+                //分类:添加、修改操作中 检测类别名称是否有重复
             case 'check_class_name':
-                $condition[]=array('storeclass_name','=',input('get.storeclass_name'));
+                $condition[] = array('storeclass_name', '=', input('get.storeclass_name'));
                 $class_list = $storeclass_model->getStoreclassList($condition);
                 $return = empty($class_list) ? 'true' : 'false';
                 break;
@@ -166,7 +174,8 @@ class Storeclass extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'store_class',
@@ -176,10 +185,9 @@ class Storeclass extends AdminControl {
             array(
                 'name' => 'store_class_add',
                 'text' => lang('ds_new'),
-                'url' => "javascript:dsLayerOpen('".(string)url('Storeclass/store_class_add')."','".lang('ds_new')."')"
+                'url' => "javascript:dsLayerOpen('" . (string)url('Storeclass/store_class_add') . "','" . lang('ds_new') . "')"
             )
         );
         return $menu_array;
     }
-
 }

+ 104 - 93
app/admin/controller/Storedeposit.php

@@ -1,26 +1,30 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 use think\facade\Db;
 use app\common\model\Storedepositlog;
 use app\common\model\Storemoneylog;
+
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Storedeposit extends AdminControl {
+class Storedeposit extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/storedeposit.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/storedeposit.lang.php');
     }
 
 
@@ -28,31 +32,32 @@ class Storedeposit extends AdminControl {
      * 资金明细
      */
 
-    public function index() {
+    public function index()
+    {
         $condition = array();
         $stime = input('get.stime');
         $etime = input('get.etime');
         $if_start_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $stime);
         $if_end_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $etime);
         $start_unixtime = $if_start_date ? strtotime($stime) : null;
-        $end_unixtime = $if_end_date ? (strtotime($etime)+86399) : null;
+        $end_unixtime = $if_end_date ? (strtotime($etime) + 86399) : null;
         if ($start_unixtime) {
-            $condition[] = array('storedepositlog_add_time','>=', $start_unixtime);
+            $condition[] = array('storedepositlog_add_time', '>=', $start_unixtime);
         }
         if ($end_unixtime) {
-            $condition[] = array('storedepositlog_add_time','<=', $end_unixtime);
+            $condition[] = array('storedepositlog_add_time', '<=', $end_unixtime);
         }
         $mname = input('get.mname');
         if (!empty($mname)) {
-            $condition[]=array('store_name','like','%'.$mname.'%');
+            $condition[] = array('store_name', 'like', '%' . $mname . '%');
         }
         $storedepositlog_model = model('storedepositlog');
         $list_log = $storedepositlog_model->getStoredepositlogList($condition, 10, '*', 'storedepositlog_id desc');
         View::assign('show_page', $storedepositlog_model->page_info->render());
         View::assign('list_log', $list_log);
-        
+
         View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
-        
+
         $this->setAdminCurItem('index');
         return View::fetch();
     }
@@ -60,20 +65,21 @@ class Storedeposit extends AdminControl {
     /*
      * 提现列表
      */
-    public function withdraw_list() {
-        $condition = array(array('storedepositlog_type','in',[Storedepositlog::TYPE_WITHDRAW,Storedepositlog::TYPE_RECHARGE]),);
+    public function withdraw_list()
+    {
+        $condition = array(array('storedepositlog_type', 'in', [Storedepositlog::TYPE_WITHDRAW, Storedepositlog::TYPE_RECHARGE]),);
         $paystate_search = input('param.paystate_search');
         if (isset($paystate_search) && $paystate_search !== '') {
-            $condition[] = array('storedepositlog_state','=',intval($paystate_search));
+            $condition[] = array('storedepositlog_state', '=', intval($paystate_search));
         }
 
         $storedepositlog_model = model('storedepositlog');
         $withdraw_list = $storedepositlog_model->getStoredepositlogList($condition, 10, '*', 'storedepositlog_id desc');
         View::assign('show_page', $storedepositlog_model->page_info->render());
         View::assign('withdraw_list', $withdraw_list);
-        
+
         View::assign('filtered', input('get.') ? 1 : 0); //是否有查询条件
-        
+
         $this->setAdminCurItem('withdraw_list');
         return View::fetch();
     }
@@ -83,60 +89,61 @@ class Storedeposit extends AdminControl {
     /**
      * 查看提现信息
      */
-    public function withdraw_view() {
+    public function withdraw_view()
+    {
         $id = intval(input('param.id'));
         if ($id <= 0) {
             $this->error(lang('param_error'));
         }
         $storedepositlog_model = model('storedepositlog');
         $condition = array();
-        $condition[] = array('storedepositlog_id','=',$id);
+        $condition[] = array('storedepositlog_id', '=', $id);
         $info = $storedepositlog_model->getStoredepositlogInfo($condition);
         if (!is_array($info) || count($info) < 0) {
             $this->error(lang('admin_storedeposit_record_error'));
         }
-        if(!request()->isPost()){
+        if (!request()->isPost()) {
             View::assign('info', $info);
             return View::fetch();
-        }else{
-            if(!input('param.verify_reason')){
-                $this->error(lang('ds_none_input').lang('admin_storedeposit_remark'));
+        } else {
+            if (!input('param.verify_reason')) {
+                $this->error(lang('ds_none_input') . lang('admin_storedeposit_remark'));
             }
-            $data=array(
-                'store_id'=>$info['store_id'],
-                'store_name'=>$info['store_name'],
-                'storedepositlog_type'=>Storedepositlog::TYPE_VERIFY,
-                'storedepositlog_state'=>Storedepositlog::STATE_VALID,
-                'storedepositlog_add_time'=>TIMESTAMP,
+            $data = array(
+                'store_id' => $info['store_id'],
+                'store_name' => $info['store_name'],
+                'storedepositlog_type' => Storedepositlog::TYPE_VERIFY,
+                'storedepositlog_state' => Storedepositlog::STATE_VALID,
+                'storedepositlog_add_time' => TIMESTAMP,
             );
-            if(input('param.verify_state')==1){//通过
-                    $data['store_freeze_deposit']=-$info['store_freeze_deposit'];
-                    $storedepositlog_state=Storedepositlog::STATE_AGREE;
-            }else{
-                $data['store_avaliable_deposit']=$info['store_freeze_deposit'];
-                    $data['store_freeze_deposit']=-$info['store_freeze_deposit'];
-                    $storedepositlog_state=Storedepositlog::STATE_REJECT;
+            if (input('param.verify_state') == 1) { //通过
+                $data['store_freeze_deposit'] = -$info['store_freeze_deposit'];
+                $storedepositlog_state = Storedepositlog::STATE_AGREE;
+            } else {
+                $data['store_avaliable_deposit'] = $info['store_freeze_deposit'];
+                $data['store_freeze_deposit'] = -$info['store_freeze_deposit'];
+                $storedepositlog_state = Storedepositlog::STATE_REJECT;
             }
             $admininfo = $this->getAdminInfo();
-            $data['storedepositlog_desc']=lang('order_admin_operator')."【" . $admininfo['admin_name'] . "】".((input('param.verify_state')==1)?lang('ds_pass'):lang('ds_refuse')).lang('ds_seller_name')."【" . $info['store_name'] . "】".lang('admin_storedeposit_log_stage_cash').':'.input('param.verify_reason');
+            $data['storedepositlog_desc'] = lang('order_admin_operator') . "【" . $admininfo['admin_name'] . "】" . ((input('param.verify_state') == 1) ? lang('ds_pass') : lang('ds_refuse')) . lang('ds_seller_name') . "【" . $info['store_name'] . "】" . lang('admin_storedeposit_log_stage_cash') . ':' . input('param.verify_reason');
             try {
                 Db::startTrans();
                 $storedepositlog_model->changeStoredeposit($data);
                 //修提现状态
-                if(!$storedepositlog_model->editStoredepositlog(array('storedepositlog_id'=>$id,'storedepositlog_state'=>Storedepositlog::STATE_WAIT),array('storedepositlog_state'=>$storedepositlog_state))){
+                if (!$storedepositlog_model->editStoredepositlog(array('storedepositlog_id' => $id, 'storedepositlog_state' => Storedepositlog::STATE_WAIT), array('storedepositlog_state' => $storedepositlog_state))) {
                     throw new \think\Exception(lang('admin_storedeposit_cash_edit_fail'), 10006);
                 }
                 //如果是通过取出保证金,则将保证金转换为店铺可用资金
-                if(input('param.verify_state')==1){
+                if (input('param.verify_state') == 1) {
                     $storemoneylog_model = model('storemoneylog');
-                    $data2=array(
-                        'store_id'=>$info['store_id'],
-                        'store_name'=>$info['store_name'],
-                        'storemoneylog_type'=>Storemoneylog::TYPE_DEPOSIT_OUT,
-                        'storemoneylog_state'=>Storemoneylog::STATE_VALID,
-                        'storemoneylog_add_time'=>TIMESTAMP,
-                        'store_avaliable_money'=>$info['store_freeze_deposit'],
-                        'storemoneylog_desc'=>$data['storedepositlog_desc'],
+                    $data2 = array(
+                        'store_id' => $info['store_id'],
+                        'store_name' => $info['store_name'],
+                        'storemoneylog_type' => Storemoneylog::TYPE_DEPOSIT_OUT,
+                        'storemoneylog_state' => Storemoneylog::STATE_VALID,
+                        'storemoneylog_add_time' => TIMESTAMP,
+                        'store_avaliable_money' => $info['store_freeze_deposit'],
+                        'storemoneylog_desc' => $data['storedepositlog_desc'],
                     );
                     $storemoneylog_model->changeStoremoney($data2);
                 }
@@ -151,50 +158,51 @@ class Storedeposit extends AdminControl {
             dsLayerOpenSuccess(lang('ds_common_op_succ'));
         }
     }
-    
-    
-    public function recharge_view() {
+
+
+    public function recharge_view()
+    {
         $id = intval(input('param.id'));
         if ($id <= 0) {
             $this->error(lang('param_error'));
         }
         $storedepositlog_model = model('storedepositlog');
         $condition = array();
-        $condition[] = array('storedepositlog_id','=',$id);
+        $condition[] = array('storedepositlog_id', '=', $id);
         $info = $storedepositlog_model->getStoredepositlogInfo($condition);
         if (!is_array($info) || count($info) < 0) {
             $this->error(lang('admin_storedeposit_record_error'));
         }
-        if(!request()->isPost()){
+        if (!request()->isPost()) {
             View::assign('info', $info);
             return View::fetch();
-        }else{
-            if(!input('param.verify_reason')){
-                $this->error(lang('ds_none_input').lang('admin_storedeposit_remark'));
+        } else {
+            if (!input('param.verify_reason')) {
+                $this->error(lang('ds_none_input') . lang('admin_storedeposit_remark'));
             }
-            $data=array(
-                'store_id'=>$info['store_id'],
-                'store_name'=>$info['store_name'],
-                'storedepositlog_type'=>Storedepositlog::TYPE_VIEW,
-                'storedepositlog_state'=>Storedepositlog::STATE_VALID,
-                'storedepositlog_add_time'=>TIMESTAMP,
+            $data = array(
+                'store_id' => $info['store_id'],
+                'store_name' => $info['store_name'],
+                'storedepositlog_type' => Storedepositlog::TYPE_VIEW,
+                'storedepositlog_state' => Storedepositlog::STATE_VALID,
+                'storedepositlog_add_time' => TIMESTAMP,
             );
-            if(input('param.verify_state')==1){//通过
-                $data['store_avaliable_deposit']=$info['store_payable_deposit'];
-                    $data['store_payable_deposit']=-$info['store_payable_deposit'];
-                    $storedepositlog_state=Storedepositlog::STATE_PAYED;
-            }else{
-                    $data['store_payable_deposit']=-$info['store_payable_deposit'];
-                    $storedepositlog_state=Storedepositlog::STATE_CANCEL;
+            if (input('param.verify_state') == 1) { //通过
+                $data['store_avaliable_deposit'] = $info['store_payable_deposit'];
+                $data['store_payable_deposit'] = -$info['store_payable_deposit'];
+                $storedepositlog_state = Storedepositlog::STATE_PAYED;
+            } else {
+                $data['store_payable_deposit'] = -$info['store_payable_deposit'];
+                $storedepositlog_state = Storedepositlog::STATE_CANCEL;
             }
             $admininfo = $this->getAdminInfo();
-            $data['storedepositlog_desc']=lang('order_admin_operator')."【" . $admininfo['admin_name'] . "】".lang('ds_update').lang('ds_seller_name')."【" . $info['store_name'] . "】".lang('admin_storedeposit_pay_state').((input('param.verify_state')==1)?lang('admin_storedeposit_payed'):lang('admin_storedeposit_cancel')).':'.input('param.verify_reason');
+            $data['storedepositlog_desc'] = lang('order_admin_operator') . "【" . $admininfo['admin_name'] . "】" . lang('ds_update') . lang('ds_seller_name') . "【" . $info['store_name'] . "】" . lang('admin_storedeposit_pay_state') . ((input('param.verify_state') == 1) ? lang('admin_storedeposit_payed') : lang('admin_storedeposit_cancel')) . ':' . input('param.verify_reason');
             try {
                 Db::startTrans();
                 $storedepositlog_model->changeStoredeposit($data);
                 //修提现状态
-                if(!$storedepositlog_model->editStoredepositlog(array('storedepositlog_id'=>$id,'storedepositlog_state'=>Storedepositlog::STATE_PAYING),array('storedepositlog_state'=>$storedepositlog_state))){
-                    throw new \think\Exception(lang('admin_storedeposit_pay_state').lang('ds_update').lang('ds_fail'), 10006);
+                if (!$storedepositlog_model->editStoredepositlog(array('storedepositlog_id' => $id, 'storedepositlog_state' => Storedepositlog::STATE_PAYING), array('storedepositlog_state' => $storedepositlog_state))) {
+                    throw new \think\Exception(lang('admin_storedeposit_pay_state') . lang('ds_update') . lang('ds_fail'), 10006);
                 }
 
                 Db::commit();
@@ -213,15 +221,16 @@ class Storedeposit extends AdminControl {
      * 调节资金
      */
 
-    public function adjust() {
+    public function adjust()
+    {
         if (!(request()->isPost())) {
             $store_id = intval(input('get.store_id'));
-            if($store_id>0){
+            if ($store_id > 0) {
                 $condition = array();
-                $condition[] = array('store_id','=',$store_id);
+                $condition[] = array('store_id', '=', $store_id);
                 $store = model('store')->getStoreInfo($condition);
-                if(!empty($store)){
-                    View::assign('store_info',$store);
+                if (!empty($store)) {
+                    View::assign('store_info', $store);
                 }
             }
             return View::fetch();
@@ -233,7 +242,7 @@ class Storedeposit extends AdminControl {
                 'lg_desc' => input('post.lg_desc'),
             );
             $storedeposit_validate = ds_validate('storedeposit');
-            if (!$storedeposit_validate->scene('adjust')->check($data)){
+            if (!$storedeposit_validate->scene('adjust')->check($data)) {
                 $this->error($storedeposit_validate->getError());
             }
 
@@ -260,27 +269,27 @@ class Storedeposit extends AdminControl {
             $storedepositlog_model = model('storedepositlog');
             #生成对应订单号
             $admininfo = $this->getAdminInfo();
-            $data=array(
-                'store_id'=>$store_info['store_id'],
-                'store_name'=>$store_info['store_name'],
-                'storedepositlog_type'=>Storedepositlog::TYPE_ADMIN,
-                'storedepositlog_state'=>Storedepositlog::STATE_VALID,
-                'storedepositlog_add_time'=>TIMESTAMP,
+            $data = array(
+                'store_id' => $store_info['store_id'],
+                'store_name' => $store_info['store_name'],
+                'storedepositlog_type' => Storedepositlog::TYPE_ADMIN,
+                'storedepositlog_state' => Storedepositlog::STATE_VALID,
+                'storedepositlog_add_time' => TIMESTAMP,
             );
             switch ($operatetype) {
                 case 1:
-                    $data['store_avaliable_deposit']=$money;
-                    $log_msg = lang('order_admin_operator')."【" . $admininfo['admin_name'] . "】".lang('ds_handle').lang('ds_seller_name')."【" . $store_info['store_name'] . "】".lang('ds_store_deposit')."【".lang('admin_storedeposit_artificial_operatetype_add')."】,".lang('admin_storedeposit_price') . $money;
+                    $data['store_avaliable_deposit'] = $money;
+                    $log_msg = lang('order_admin_operator') . "【" . $admininfo['admin_name'] . "】" . lang('ds_handle') . lang('ds_seller_name') . "【" . $store_info['store_name'] . "】" . lang('ds_store_deposit') . "【" . lang('admin_storedeposit_artificial_operatetype_add') . "】," . lang('admin_storedeposit_price') . $money;
                     break;
                 case 2:
-                    $data['store_avaliable_deposit']=-$money;
-                    $log_msg = lang('order_admin_operator')."【" . $admininfo['admin_name'] . "】".lang('ds_handle').lang('ds_seller_name')."【" . $store_info['store_name'] . "】".lang('ds_store_deposit')."【".lang('admin_storedeposit_artificial_operatetype_reduce')."】,".lang('admin_storedeposit_price') . $money;
+                    $data['store_avaliable_deposit'] = -$money;
+                    $log_msg = lang('order_admin_operator') . "【" . $admininfo['admin_name'] . "】" . lang('ds_handle') . lang('ds_seller_name') . "【" . $store_info['store_name'] . "】" . lang('ds_store_deposit') . "【" . lang('admin_storedeposit_artificial_operatetype_reduce') . "】," . lang('admin_storedeposit_price') . $money;
                     break;
                 default:
                     $this->error(lang('ds_common_op_fail'), 'Storedeposit/index');
                     break;
             }
-            $data['storedepositlog_desc']=$log_msg;
+            $data['storedepositlog_desc'] = $log_msg;
             try {
                 Db::startTrans();
                 $storedepositlog_model->changeStoredeposit($data);
@@ -296,7 +305,8 @@ class Storedeposit extends AdminControl {
     }
 
     //取得店主信息
-    public function checkseller() {
+    public function checkseller()
+    {
         $name = input('post.name');
         if (!$name) {
             exit(json_encode(array('id' => 0)));
@@ -310,11 +320,12 @@ class Storedeposit extends AdminControl {
             exit(json_encode(array('id' => 0)));
         }
     }
-    
+
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -329,7 +340,7 @@ class Storedeposit extends AdminControl {
             array(
                 'name' => 'adjust',
                 'text' => lang('admin_storedeposit_adjust'),
-                'url' => "javascript:dsLayerOpen('".(string)url('Storedeposit/adjust')."','".lang('admin_storedeposit_adjust')."')"
+                'url' => "javascript:dsLayerOpen('" . (string)url('Storedeposit/adjust') . "','" . lang('admin_storedeposit_adjust') . "')"
             ),
         );
         return $menu_array;

+ 38 - 28
app/admin/controller/Storegrade.php

@@ -1,29 +1,33 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Storegrade extends AdminControl {
+class Storegrade extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/storegrade.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/storegrade.lang.php');
     }
 
-    public function index() {
+    public function index()
+    {
         $like_storegrade_name = trim(input('param.like_storegrade_name'));
-        $condition[]=array('storegrade_name','like', "%" . $like_storegrade_name . "%");
+        $condition[] = array('storegrade_name', 'like', "%" . $like_storegrade_name . "%");
         $storegrade_list = model('storegrade')->getStoregradeList($condition);
         // 获取分页显示
         View::assign('storegrade_list', $storegrade_list);
@@ -32,7 +36,8 @@ class Storegrade extends AdminControl {
         return View::fetch();
     }
 
-    public function add() {
+    public function add()
+    {
         if (!request()->isPost()) {
             return View::fetch('form');
         } else {
@@ -47,7 +52,7 @@ class Storegrade extends AdminControl {
             );
 
             $storegrade_validate = ds_validate('storegrade');
-            if (!$storegrade_validate->scene('add')->check($data)){
+            if (!$storegrade_validate->scene('add')->check($data)) {
                 $this->error($storegrade_validate->getError());
             }
 
@@ -61,14 +66,15 @@ class Storegrade extends AdminControl {
             }
             $result = model('storegrade')->addStoregrade($data);
             if ($result) {
-                dsLayerOpenSuccess(lang('ds_common_op_succ'),(string)url('Storegrade/index'));
+                dsLayerOpenSuccess(lang('ds_common_op_succ'), (string)url('Storegrade/index'));
             } else {
                 $this->error(lang('ds_common_op_fail'));
             }
         }
     }
 
-    public function edit() {
+    public function edit()
+    {
         //注:pathinfo地址参数不能通过get方法获取,查看“获取PARAM变量”
         $storegrade_id = input('param.storegrade_id');
         if (empty($storegrade_id)) {
@@ -90,7 +96,7 @@ class Storegrade extends AdminControl {
                 'storegrade_sort' => input('post.storegrade_sort'),
             );
             $storegrade_validate = ds_validate('storegrade');
-            if (!$storegrade_validate->scene('edit')->check($data)){
+            if (!$storegrade_validate->scene('edit')->check($data)) {
                 $this->error($storegrade_validate->getError());
             }
             //验证等级名称
@@ -101,19 +107,20 @@ class Storegrade extends AdminControl {
             if (!$this->checkGradeSort(array('storegrade_sort' => trim(input('post.storegrade_sort')), 'storegrade_id' => intval(input('param.storegrade_id'))))) {
                 $this->error(lang('add_gradesortexist'));
             }
-            $result = model('storegrade')->editStoregrade($storegrade_id,$data);
-            if ($result>=0) {
-                dsLayerOpenSuccess(lang('ds_common_op_succ'),(string)url('Storegrade/index'));
+            $result = model('storegrade')->editStoregrade($storegrade_id, $data);
+            if ($result >= 0) {
+                dsLayerOpenSuccess(lang('ds_common_op_succ'), (string)url('Storegrade/index'));
             } else {
                 $this->error(lang('ds_common_op_fail'));
             }
         }
     }
 
-    public function drop() {
+    public function drop()
+    {
         //注:pathinfo地址参数不能通过get方法获取,查看“获取PARAM变量”
         $storegrade_id = intval(input('param.storegrade_id'));
-        if ($storegrade_id<=0) {
+        if ($storegrade_id <= 0) {
             ds_json_encode(10001, lang('param_error'));
         }
         if ($storegrade_id == '1') {
@@ -134,13 +141,14 @@ class Storegrade extends AdminControl {
     /**
      * 查询店铺等级名称是否存在
      */
-    private function checkGradeName($param) {
+    private function checkGradeName($param)
+    {
         $storegrade_model = model('storegrade');
-        $condition[]=array('storegrade_name','=',$param['storegrade_name']);
+        $condition[] = array('storegrade_name', '=', $param['storegrade_name']);
 
         if (isset($param['storegrade_id'])) {
             $storegrade_id = intval($param['storegrade_id']);
-            $condition[]=array('storegrade_id','<>', $storegrade_id);
+            $condition[] = array('storegrade_id', '<>', $storegrade_id);
         }
         $list = $storegrade_model->getStoregradeList($condition);
         if (empty($list)) {
@@ -153,13 +161,14 @@ class Storegrade extends AdminControl {
     /**
      * 查询店铺等级是否存在
      */
-    private function checkGradeSort($param) {
+    private function checkGradeSort($param)
+    {
         $storegrade_model = model('storegrade');
         $condition = array();
-        $condition[]=array('storegrade_sort','=',$param['storegrade_sort']);
+        $condition[] = array('storegrade_sort', '=', $param['storegrade_sort']);
         if (isset($param['storegrade_id'])) {
             $storegrade_id = intval($param['storegrade_id']);
-            $condition[]=array('storegrade_id','<>', $storegrade_id);
+            $condition[] = array('storegrade_id', '<>', $storegrade_id);
         }
         $list = array();
         $list = $storegrade_model->getStoregradeList($condition);
@@ -173,7 +182,8 @@ class Storegrade extends AdminControl {
     /**
      * 判断店铺等级是否能删除
      */
-    public function isable_delStoregrade($storegrade_id) {
+    public function isable_delStoregrade($storegrade_id)
+    {
         //判断该等级下是否存在店铺,存在的话不能删除
         $store_model = model('store');
         $store_list = $store_model->getStoreList(array('grade_id' => $storegrade_id));
@@ -186,7 +196,8 @@ class Storegrade extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -199,10 +210,9 @@ class Storegrade extends AdminControl {
             $menu_array[] = array(
                 'name' => 'add',
                 'text' => lang('ds_new'),
-                'url' => "javascript:dsLayerOpen('".(string)url('Storegrade/add')."','".lang('ds_new')."')"
+                'url' => "javascript:dsLayerOpen('" . (string)url('Storegrade/add') . "','" . lang('ds_new') . "')"
             );
         }
         return $menu_array;
     }
-
 }

+ 3 - 3
app/admin/controller/Storehelp.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Storehelp extends AdminControl

+ 3 - 3
app/admin/controller/Storejoin.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Storejoin extends AdminControl

+ 88 - 77
app/admin/controller/Storemoney.php

@@ -1,25 +1,29 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 use think\facade\Db;
 use app\common\model\Storemoneylog;
+
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Storemoney extends AdminControl {
+class Storemoney extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/storemoney.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/storemoney.lang.php');
     }
 
 
@@ -27,31 +31,32 @@ class Storemoney extends AdminControl {
      * 资金明细
      */
 
-    public function index() {
+    public function index()
+    {
         $condition = array();
         $stime = input('get.stime');
         $etime = input('get.etime');
         $if_start_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $stime);
         $if_end_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $etime);
         $start_unixtime = $if_start_date ? strtotime($stime) : null;
-        $end_unixtime = $if_end_date ? (strtotime($etime)+86399) : null;
+        $end_unixtime = $if_end_date ? (strtotime($etime) + 86399) : null;
         if ($start_unixtime) {
-            $condition[] = array('storemoneylog_add_time','>=', $start_unixtime);
+            $condition[] = array('storemoneylog_add_time', '>=', $start_unixtime);
         }
         if ($end_unixtime) {
-            $condition[] = array('storemoneylog_add_time','<=', $end_unixtime);
+            $condition[] = array('storemoneylog_add_time', '<=', $end_unixtime);
         }
         $mname = input('get.mname');
         if (!empty($mname)) {
-            $condition[]=array('store_name','like','%'.$mname.'%');
+            $condition[] = array('store_name', 'like', '%' . $mname . '%');
         }
         $storemoneylog_model = model('storemoneylog');
         $list_log = $storemoneylog_model->getStoremoneylogList($condition, 10, '*', 'storemoneylog_id desc');
         View::assign('show_page', $storemoneylog_model->page_info->render());
         View::assign('list_log', $list_log);
-        
+
         View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
-        
+
         $this->setAdminCurItem('index');
         return View::fetch();
     }
@@ -59,21 +64,22 @@ class Storemoney extends AdminControl {
     /*
      * 提现列表
      */
-    public function withdraw_list() {
+    public function withdraw_list()
+    {
         $condition = array();
-        $condition[] = array('storemoneylog_type','=',Storemoneylog::TYPE_WITHDRAW);
+        $condition[] = array('storemoneylog_type', '=', Storemoneylog::TYPE_WITHDRAW);
         $paystate_search = input('param.paystate_search');
         if (isset($paystate_search) && $paystate_search !== '') {
-            $condition[] = array('storemoneylog_state','=',intval($paystate_search));
+            $condition[] = array('storemoneylog_state', '=', intval($paystate_search));
         }
 
         $storemoneylog_model = model('storemoneylog');
         $withdraw_list = $storemoneylog_model->getStoremoneylogList($condition, 10, '*', 'storemoneylog_id desc');
         View::assign('show_page', $storemoneylog_model->page_info->render());
         View::assign('withdraw_list', $withdraw_list);
-        
+
         View::assign('filtered', input('get.') ? 1 : 0); //是否有查询条件
-        
+
         $this->setAdminCurItem('withdraw_list');
         return View::fetch();
     }
@@ -81,25 +87,26 @@ class Storemoney extends AdminControl {
     /*
      * 提现设置
      */
-    public function withdraw_set(){
+    public function withdraw_set()
+    {
         $config_model = model('config');
-        if(!request()->isPost()){
+        if (!request()->isPost()) {
             $list_setting = rkcache('config', true);
-            View::assign('list_setting',$list_setting);
+            View::assign('list_setting', $list_setting);
             $this->setAdminCurItem('withdraw_set');
             return View::fetch();
-        }else{
-            $update_array=array(
-                'store_withdraw_min'=>abs(round(input('post.store_withdraw_min'),2)),
-                'store_withdraw_max'=>abs(round(input('post.store_withdraw_max'),2)),
-                'store_withdraw_cycle'=>abs(intval(input('post.store_withdraw_cycle'))),
+        } else {
+            $update_array = array(
+                'store_withdraw_min' => abs(round(input('post.store_withdraw_min'), 2)),
+                'store_withdraw_max' => abs(round(input('post.store_withdraw_max'), 2)),
+                'store_withdraw_cycle' => abs(intval(input('post.store_withdraw_cycle'))),
             );
             $result = $config_model->editConfig($update_array);
             if ($result) {
-                $this->log(lang('ds_update').lang('admin_storemoney_withdraw_set'),1);
+                $this->log(lang('ds_update') . lang('admin_storemoney_withdraw_set'), 1);
                 $this->success(lang('ds_common_op_succ'), 'Storemoney/withdraw_set');
-            }else{
-                $this->log(lang('ds_update').lang('admin_storemoney_withdraw_set'),0);
+            } else {
+                $this->log(lang('ds_update') . lang('admin_storemoney_withdraw_set'), 0);
             }
         }
     }
@@ -107,47 +114,48 @@ class Storemoney extends AdminControl {
     /**
      * 查看提现信息
      */
-    public function withdraw_view() {
+    public function withdraw_view()
+    {
         $id = intval(input('param.id'));
         if ($id <= 0) {
             $this->error(lang('param_error'));
         }
         $storemoneylog_model = model('storemoneylog');
         $condition = array();
-        $condition[] = array('storemoneylog_id','=',$id);
+        $condition[] = array('storemoneylog_id', '=', $id);
         $info = $storemoneylog_model->getStoremoneylogInfo($condition);
         if (!is_array($info) || count($info) < 0) {
             $this->error(lang('admin_storemoney_record_error'));
         }
-        if(!request()->isPost()){
+        if (!request()->isPost()) {
             View::assign('info', $info);
             return View::fetch();
-        }else{
-            if(!input('param.verify_reason')){
-                $this->error(lang('ds_none_input').lang('admin_storemoney_remark'));
+        } else {
+            if (!input('param.verify_reason')) {
+                $this->error(lang('ds_none_input') . lang('admin_storemoney_remark'));
             }
-            $data=array(
-                'store_id'=>$info['store_id'],
-                'store_name'=>$info['store_name'],
-                'storemoneylog_type'=>Storemoneylog::TYPE_VERIFY,
-                'storemoneylog_state'=>Storemoneylog::STATE_VALID,
-                'storemoneylog_add_time'=>TIMESTAMP,
+            $data = array(
+                'store_id' => $info['store_id'],
+                'store_name' => $info['store_name'],
+                'storemoneylog_type' => Storemoneylog::TYPE_VERIFY,
+                'storemoneylog_state' => Storemoneylog::STATE_VALID,
+                'storemoneylog_add_time' => TIMESTAMP,
             );
-            if(input('param.verify_state')==1){//通过
-                    $data['store_freeze_money']=-$info['store_freeze_money'];
-                    $storemoneylog_state=Storemoneylog::STATE_AGREE;
-            }else{
-                $data['store_avaliable_money']=$info['store_freeze_money'];
-                    $data['store_freeze_money']=-$info['store_freeze_money'];
-                    $storemoneylog_state=Storemoneylog::STATE_REJECT;
+            if (input('param.verify_state') == 1) { //通过
+                $data['store_freeze_money'] = -$info['store_freeze_money'];
+                $storemoneylog_state = Storemoneylog::STATE_AGREE;
+            } else {
+                $data['store_avaliable_money'] = $info['store_freeze_money'];
+                $data['store_freeze_money'] = -$info['store_freeze_money'];
+                $storemoneylog_state = Storemoneylog::STATE_REJECT;
             }
             $admininfo = $this->getAdminInfo();
-            $data['storemoneylog_desc']=lang('order_admin_operator')."【" . $admininfo['admin_name'] . "】".((input('param.verify_state')==1)?lang('ds_pass'):lang('ds_refuse')).lang('ds_seller_name')."【" . $info['store_name'] . "】".lang('admin_storemoney_log_stage_cash').':'.input('param.verify_reason');
+            $data['storemoneylog_desc'] = lang('order_admin_operator') . "【" . $admininfo['admin_name'] . "】" . ((input('param.verify_state') == 1) ? lang('ds_pass') : lang('ds_refuse')) . lang('ds_seller_name') . "【" . $info['store_name'] . "】" . lang('admin_storemoney_log_stage_cash') . ':' . input('param.verify_reason');
             try {
                 Db::startTrans();
                 $storemoneylog_model->changeStoremoney($data);
                 //修提现状态
-                if(!$storemoneylog_model->editStoremoneylog(array('storemoneylog_id'=>$id,'storemoneylog_state'=>Storemoneylog::STATE_WAIT),array('storemoneylog_state'=>$storemoneylog_state))){
+                if (!$storemoneylog_model->editStoremoneylog(array('storemoneylog_id' => $id, 'storemoneylog_state' => Storemoneylog::STATE_WAIT), array('storemoneylog_state' => $storemoneylog_state))) {
                     throw new \think\Exception(lang('admin_storemoney_cash_edit_fail'), 10006);
                 }
                 Db::commit();
@@ -166,15 +174,16 @@ class Storemoney extends AdminControl {
      * 调节资金
      */
 
-    public function adjust() {
+    public function adjust()
+    {
         if (!(request()->isPost())) {
             $store_id = intval(input('get.store_id'));
-            if($store_id>0){
+            if ($store_id > 0) {
                 $condition = array();
-                $condition[] = array('store_id','=',$store_id);
+                $condition[] = array('store_id', '=', $store_id);
                 $store = model('store')->getStoreInfo($condition);
-                if(!empty($store)){
-                    View::assign('store_info',$store);
+                if (!empty($store)) {
+                    View::assign('store_info', $store);
                 }
             }
             return View::fetch();
@@ -186,7 +195,7 @@ class Storemoney extends AdminControl {
                 'lg_desc' => input('post.lg_desc'),
             );
             $storedeposit_validate = ds_validate('storedeposit');
-            if (!$storedeposit_validate->scene('adjust')->check($data)){
+            if (!$storedeposit_validate->scene('adjust')->check($data)) {
                 $this->error($storedeposit_validate->getError());
             }
 
@@ -217,37 +226,37 @@ class Storemoney extends AdminControl {
             $storemoneylog_model = model('storemoneylog');
             #生成对应订单号
             $admininfo = $this->getAdminInfo();
-            $data=array(
-                'store_id'=>$store_info['store_id'],
-                'store_name'=>$store_info['store_name'],
-                'storemoneylog_type'=>Storemoneylog::TYPE_ADMIN,
-                'storemoneylog_state'=>Storemoneylog::STATE_VALID,
-                'storemoneylog_add_time'=>TIMESTAMP,
+            $data = array(
+                'store_id' => $store_info['store_id'],
+                'store_name' => $store_info['store_name'],
+                'storemoneylog_type' => Storemoneylog::TYPE_ADMIN,
+                'storemoneylog_state' => Storemoneylog::STATE_VALID,
+                'storemoneylog_add_time' => TIMESTAMP,
             );
             switch ($operatetype) {
                 case 1:
-                    $data['store_avaliable_money']=$money;
-                    $log_msg = lang('order_admin_operator')."【" . $admininfo['admin_name'] . "】".lang('ds_handle').lang('ds_seller_name')."【" . $store_info['store_name'] . "】".lang('ds_store_money')."【".lang('admin_storemoney_artificial_operatetype_add')."】,".lang('admin_storemoney_price') . $money;
+                    $data['store_avaliable_money'] = $money;
+                    $log_msg = lang('order_admin_operator') . "【" . $admininfo['admin_name'] . "】" . lang('ds_handle') . lang('ds_seller_name') . "【" . $store_info['store_name'] . "】" . lang('ds_store_money') . "【" . lang('admin_storemoney_artificial_operatetype_add') . "】," . lang('admin_storemoney_price') . $money;
                     break;
                 case 2:
-                    $data['store_avaliable_money']=-$money;
-                    $log_msg = lang('order_admin_operator')."【" . $admininfo['admin_name'] . "】".lang('ds_handle').lang('ds_seller_name')."【" . $store_info['store_name'] . "】".lang('ds_store_money')."【".lang('admin_storemoney_artificial_operatetype_reduce')."】,".lang('admin_storemoney_price') . $money;
+                    $data['store_avaliable_money'] = -$money;
+                    $log_msg = lang('order_admin_operator') . "【" . $admininfo['admin_name'] . "】" . lang('ds_handle') . lang('ds_seller_name') . "【" . $store_info['store_name'] . "】" . lang('ds_store_money') . "【" . lang('admin_storemoney_artificial_operatetype_reduce') . "】," . lang('admin_storemoney_price') . $money;
                     break;
                 case 3:
-                    $data['store_avaliable_money']=-$money;
-                    $data['store_freeze_money']=$money;
-                    $log_msg = lang('order_admin_operator')."【" . $admininfo['admin_name'] . "】".lang('ds_handle').lang('ds_seller_name')."【" . $store_info['store_name'] . "】".lang('ds_store_money')."【".lang('admin_storemoney_artificial_operatetype_freeze')."】,".lang('admin_storemoney_price') . $money;
+                    $data['store_avaliable_money'] = -$money;
+                    $data['store_freeze_money'] = $money;
+                    $log_msg = lang('order_admin_operator') . "【" . $admininfo['admin_name'] . "】" . lang('ds_handle') . lang('ds_seller_name') . "【" . $store_info['store_name'] . "】" . lang('ds_store_money') . "【" . lang('admin_storemoney_artificial_operatetype_freeze') . "】," . lang('admin_storemoney_price') . $money;
                     break;
                 case 4:
-                    $data['store_avaliable_money']=$money;
-                    $data['store_freeze_money']=-$money;
-                    $log_msg = lang('order_admin_operator')."【" . $admininfo['admin_name'] . "】".lang('ds_handle').lang('ds_seller_name')."【" . $store_info['store_name'] . "】".lang('ds_store_money')."【".lang('admin_storemoney_artificial_operatetype_unfreeze')."】,".lang('admin_storemoney_price') . $money;
+                    $data['store_avaliable_money'] = $money;
+                    $data['store_freeze_money'] = -$money;
+                    $log_msg = lang('order_admin_operator') . "【" . $admininfo['admin_name'] . "】" . lang('ds_handle') . lang('ds_seller_name') . "【" . $store_info['store_name'] . "】" . lang('ds_store_money') . "【" . lang('admin_storemoney_artificial_operatetype_unfreeze') . "】," . lang('admin_storemoney_price') . $money;
                     break;
                 default:
                     $this->error(lang('ds_common_op_fail'), 'Storemoney/index');
                     break;
             }
-            $data['storemoneylog_desc']=$log_msg;
+            $data['storemoneylog_desc'] = $log_msg;
             try {
                 Db::startTrans();
                 $storemoneylog_model->changeStoremoney($data);
@@ -263,7 +272,8 @@ class Storemoney extends AdminControl {
     }
 
     //取得店主信息
-    public function checkseller() {
+    public function checkseller()
+    {
         $name = input('post.name');
         if (!$name) {
             exit(json_encode(array('id' => 0)));
@@ -277,11 +287,12 @@ class Storemoney extends AdminControl {
             exit(json_encode(array('id' => 0)));
         }
     }
-    
+
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -301,7 +312,7 @@ class Storemoney extends AdminControl {
             array(
                 'name' => 'adjust',
                 'text' => lang('admin_storemoney_adjust'),
-                'url' => "javascript:dsLayerOpen('".(string)url('Storemoney/adjust')."','".lang('admin_storemoney_adjust')."')"
+                'url' => "javascript:dsLayerOpen('" . (string)url('Storemoney/adjust') . "','" . lang('admin_storemoney_adjust') . "')"
             ),
         );
         return $menu_array;

+ 50 - 42
app/admin/controller/Storesnstrace.php

@@ -1,51 +1,55 @@
 <?php
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Storesnstrace extends AdminControl {
+class Storesnstrace extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize(); // TODO: Change the autogenerated stub
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/storesnstrace.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/storesnstrace.lang.php');
     }
 
     /**
      * 动态列表
      */
-    public function index() {
+    public function index()
+    {
         // where条件
         $where = array();
         if (input('get.search_sname') != '') {
-            $where[]=array('stracelog_storename','like', '%' . trim(input('get.search_sname')) . '%');
+            $where[] = array('stracelog_storename', 'like', '%' . trim(input('get.search_sname')) . '%');
         }
         if (input('get.search_stitle') != '') {
-            $where[]=array('stracelog_title','like', '%' . trim(input('get.search_stitle')) . '%');
+            $where[] = array('stracelog_title', 'like', '%' . trim(input('get.search_stitle')) . '%');
         }
         if (input('get.search_scontent') != '') {
-            $where[]=array('stracelog_content','like', '%' . trim(input('get.search_scontent')) . '%');
+            $where[] = array('stracelog_content', 'like', '%' . trim(input('get.search_scontent')) . '%');
         }
         if (input('get.search_type') != '') {
-            $where[]=array('stracelog_type','=',trim(input('get.search_type')));
+            $where[] = array('stracelog_type', '=', trim(input('get.search_type')));
         }
         if (input('get.search_stime') != '') {
             $s_time = input('get.search_stime') != '' ? strtotime(input('get.search_stime')) : null;
-            $where[] = array('stracelog_time','>=', $s_time);
+            $where[] = array('stracelog_time', '>=', $s_time);
         }
         if (input('get.search_etime') != '') {
-            $e_time = input('get.search_etime') != '' ? (strtotime(input('get.search_etime'))+86399) : null;
-            $where[] = array('stracelog_time','<=', $e_time);
+            $e_time = input('get.search_etime') != '' ? (strtotime(input('get.search_etime')) + 86399) : null;
+            $where[] = array('stracelog_time', '<=', $e_time);
         }
         // 实例化模型
         $storesnstracelog_model = model('storesnstracelog');
@@ -68,18 +72,19 @@ class Storesnstrace extends AdminControl {
     /**
      * 删除动态
      */
-    public function strace_del() {
+    public function strace_del()
+    {
         $st_id = input('param.st_id');
         $st_id_array = ds_delete_param($st_id);
         if ($st_id_array == FALSE) {
             ds_json_encode('10001', lang('param_error'));
         }
         // 删除动态
-        $rs = model('storesnstracelog')->delStoresnstracelog(array(array('stracelog_id' ,'in', $st_id_array)));
+        $rs = model('storesnstracelog')->delStoresnstracelog(array(array('stracelog_id', 'in', $st_id_array)));
         if ($rs) {
             // 删除评论
-            model('storesnscomment')->delStoresnscomment(array(array('stracelog_id','in', $st_id_array)));
-            $this->log(lang('ds_del').lang('admin_snstrace_comment'), 1);
+            model('storesnscomment')->delStoresnscomment(array(array('stracelog_id', 'in', $st_id_array)));
+            $this->log(lang('ds_del') . lang('admin_snstrace_comment'), 1);
             ds_json_encode('10000', lang('ds_common_del_succ'));
         } else {
             ds_json_encode('10001', lang('ds_common_del_fail'));
@@ -89,7 +94,8 @@ class Storesnstrace extends AdminControl {
     /**
      * 编辑动态
      */
-    public function strace_edit() {
+    public function strace_edit()
+    {
         $st_id = input('param.st_id');
         $st_id_array = ds_delete_param($st_id);
         if ($st_id_array == FALSE) {
@@ -97,19 +103,19 @@ class Storesnstrace extends AdminControl {
         }
         // where条件
         $where = array();
-        $where[]=array('stracelog_id','in', $st_id_array);
+        $where[] = array('stracelog_id', 'in', $st_id_array);
         // update条件
         $update = array();
-        
+
         if (input('param.type') == 'hide') {
             $update['stracelog_state'] = 0;
-        }else{
-			$update['stracelog_state'] = 1;
-		}
+        } else {
+            $update['stracelog_state'] = 1;
+        }
         // 实例化模型
         $rs = model('storesnstracelog')->editStoresnstracelog($update, $where);
         if ($rs) {
-            $this->log(lang('ds_edit').lang('admin_snstrace_comment'), 1);
+            $this->log(lang('ds_edit') . lang('admin_snstrace_comment'), 1);
             ds_json_encode('10000', lang('ds_common_op_succ'));
         } else {
             ds_json_encode('10001', lang('ds_common_op_fail'));
@@ -119,34 +125,35 @@ class Storesnstrace extends AdminControl {
     /**
      * 评论列表
      */
-    public function storecomment_list() {
+    public function storecomment_list()
+    {
         // where 条件
         $where = array();
         $st_id = intval(input('get.st_id'));
         if ($st_id > 0) {
-            $where[]=array('stracelog_id','=',$st_id);
+            $where[] = array('stracelog_id', '=', $st_id);
         }
-        
+
         if (input('get.search_uname') != '') {
-            $where[]=array('storesnscomm_membername','like', '%' . trim(input('get.search_uname')) . '%');
+            $where[] = array('storesnscomm_membername', 'like', '%' . trim(input('get.search_uname')) . '%');
         }
         if (input('get.search_content') != '') {
-            $where[]=array('storesnscomm_content','like', '%' . trim(input('get.search_content')) . '%');
+            $where[] = array('storesnscomm_content', 'like', '%' . trim(input('get.search_content')) . '%');
         }
         if (input('get.search_state') != '') {
-            $where[]=array('storesnscomm_state','=',intval(input('get.search_state')));
+            $where[] = array('storesnscomm_state', '=', intval(input('get.search_state')));
         }
         if (input('get.search_stime') != '') {
             $s_time = input('get.search_stime') != '' ? strtotime(input('get.search_stime')) : null;
-            $where[] = array('storesnscomm_time','>=', $s_time);
+            $where[] = array('storesnscomm_time', '>=', $s_time);
         }
         if (input('get.search_etime') != '') {
-            $e_time = input('get.search_etime') != '' ? (strtotime(input('get.search_etime'))+86399) : null;
-            $where[] = array('storesnscomm_time','<=', $e_time);
+            $e_time = input('get.search_etime') != '' ? (strtotime(input('get.search_etime')) + 86399) : null;
+            $where[] = array('storesnscomm_time', '<=', $e_time);
         }
         $model_storesnscomment = model('storesnscomment');
         $storesnscomm_list = $model_storesnscomment->getStoresnscommentList($where, '*', 'storesnscomm_id desc', 0, 20);
-        
+
         $this->setAdminCurItem('index');
         View::assign('scomm_list', $storesnscomm_list);
         View::assign('show_page', $model_storesnscomment->page_info->render());
@@ -156,16 +163,17 @@ class Storesnstrace extends AdminControl {
     /**
      * 删除评论
      */
-    public function scomm_del() {
+    public function scomm_del()
+    {
         $sc_id = input('param.sc_id');
         $sc_id_array = ds_delete_param($sc_id);
         if ($sc_id_array == FALSE) {
             ds_json_encode('10001', lang('param_error'));
         }
         // 实例化模型
-        $rs = model('storesnscomment')->delStoresnscomment(array(array('storesnscomm_id','in', $sc_id_array)));
+        $rs = model('storesnscomment')->delStoresnscomment(array(array('storesnscomm_id', 'in', $sc_id_array)));
         if ($rs) {
-            $this->log(lang('ds_del').lang('admin_snstrace_pl'), 1);
+            $this->log(lang('ds_del') . lang('admin_snstrace_pl'), 1);
             ds_json_encode('10000', lang('ds_common_del_succ'));
         } else {
             ds_json_encode('10001', lang('ds_common_del_fail'));
@@ -175,7 +183,8 @@ class Storesnstrace extends AdminControl {
     /**
      * 评论编辑
      */
-    public function scomm_edit() {
+    public function scomm_edit()
+    {
         $sc_id = input('param.sc_id');
         $sc_id_array = ds_delete_param($sc_id);
         if ($sc_id_array == FALSE) {
@@ -186,13 +195,12 @@ class Storesnstrace extends AdminControl {
             $storesnscomm_state = 0;
         }
         // 实例化模型
-        $rs = model('storesnscomment')->editStoresnscomment(array('storesnscomm_state' => $storesnscomm_state), array(array('storesnscomm_id' ,'in', $sc_id_array)));
+        $rs = model('storesnscomment')->editStoresnscomment(array('storesnscomm_state' => $storesnscomm_state), array(array('storesnscomm_id', 'in', $sc_id_array)));
         if ($rs) {
-            $this->log(lang('ds_edit').lang('admin_snstrace_pl'), 1);
+            $this->log(lang('ds_edit') . lang('admin_snstrace_pl'), 1);
             ds_json_encode('10000', lang('ds_common_op_succ'));
         } else {
             ds_json_encode('10001', lang('ds_common_op_fail'));
         }
     }
-
 }

+ 121 - 107
app/admin/controller/Type.php

@@ -5,28 +5,32 @@
  */
 
 namespace app\admin\controller;
+
 use think\facade\View;
 use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Type extends AdminControl {
+class Type extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
-        Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/type.lang.php');
+        Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/type.lang.php');
     }
 
-    public function index() {
+    public function index()
+    {
         $type_model = model('type');
         $type_list = $type_model->getTypeList('', 10);
         // 获取分页显示
@@ -40,7 +44,8 @@ class Type extends AdminControl {
      * 新增类型
      */
 
-    public function type_add() {
+    public function type_add()
+    {
         if (!(request()->isPost())) {
             $type = [
                 'class_id' => 0,
@@ -49,7 +54,7 @@ class Type extends AdminControl {
             //设置类型关联的分类
             $gc_list = model('goodsclass')->getGoodsclassListByParentId(0);
             View::assign('gc_list', $gc_list);
-            
+
             $this->setAdminCurItem('type_add');
             return View::fetch('type_form');
         } else {
@@ -83,7 +88,7 @@ class Type extends AdminControl {
                     $type_model->addTypebrand($typebrand);
                 }
             }
-            
+
             //添加类型与规格对应
             $spec_array = input('post.spec_id/a');
             if (!empty($spec_array)) {
@@ -136,7 +141,8 @@ class Type extends AdminControl {
         }
     }
 
-    public function type_edit() {
+    public function type_edit()
+    {
         $type_id = input('param.type_id');
         if (empty($type_id)) {
             $this->error(lang('param_error'));
@@ -144,7 +150,7 @@ class Type extends AdminControl {
         $type_model = model('type');
         if (!(request()->isPost())) {
             $type = $type_model->getOneType(array('type_id' => $type_id));
-            if(empty($type)){
+            if (empty($type)) {
                 $this->error(lang('param_error'));
             }
             View::assign('type', $type);
@@ -152,10 +158,10 @@ class Type extends AdminControl {
             $gc_list = model('goodsclass')->getGoodsclassListByParentId(0);
             View::assign('gc_list', $gc_list);
             //根据相同分类检索出对应的品牌
-            $b_related = $this->getBrand($type['class_id'],$type_id);
+            $b_related = $this->getBrand($type['class_id'], $type_id);
             View::assign('brand_list', $b_related);
             //根据相同分类检索出对应的规格
-            $sp_related = $this->getSpec($type['class_id'],$type_id);
+            $sp_related = $this->getSpec($type['class_id'], $type_id);
             View::assign('spec_list', $sp_related);
             //属性
             $attr_list = $type_model->typeRelatedList('attribute', array('type_id' => $type_id));
@@ -218,9 +224,9 @@ class Type extends AdminControl {
                         $attr_array['attr_sort'] = $v['sort'];
                         $attr_array['attr_show'] = isset($v['show']) && $v['show'] == "on" ? 1 : 0;
                         $condition = array();
-                        $condition[] = array('type_id','=',$type_id);
-                        $condition[] = array('attr_id','=',intval($v['attr_id']));
-                        $return = $type_model->editAttribute($condition,$attr_array);
+                        $condition[] = array('type_id', '=', $type_id);
+                        $condition[] = array('attr_id', '=', intval($v['attr_id']));
+                        $return = $type_model->editAttribute($condition, $attr_array);
                     } else if (!isset($v['form_submit'])) {
                         //添加新属性
                         if ($v['value'] != '') {
@@ -271,13 +277,14 @@ class Type extends AdminControl {
                 $type_array['type_sort'] = trim(input('post.type_sort'));
                 $type_array['class_id'] = input('post.class_id');
                 $type_array['class_name'] = input('post.class_name');
-                $type_model->editType(array('type_id' => $type_id),$type_array);
+                $type_model->editType(array('type_id' => $type_id), $type_array);
             }
             $this->success(lang('ds_common_op_succ'), 'Type/index');
         }
     }
 
-    public function attr_edit() {
+    public function attr_edit()
+    {
         $type_model = model('type');
         $attr_id = input('param.attr_id');
         if (empty($attr_id)) {
@@ -313,7 +320,7 @@ class Type extends AdminControl {
                         $update = array();
                         $update['attrvalue_name'] = $val['name'];
                         $update['attrvalue_sort'] = intval($val['sort']);
-                        $type_model->editAttributevalue(array('attrvalue_id' => intval($key)),$update);
+                        $type_model->editAttributevalue(array('attrvalue_id' => intval($key)), $update);
 
                         $attr_array[] = $val['name'];
                     } else if (!isset($val['form_submit'])) {
@@ -338,7 +345,7 @@ class Type extends AdminControl {
 
             //更新属性
             $data['attr_value'] = implode(',', $attr_array);
-            $type_model->editAttribute(array('attr_id' => $attr_id),$data);
+            $type_model->editAttribute(array('attr_id' => $attr_id), $data);
             dsLayerOpenSuccess(lang('ds_common_op_succ'));
         }
     }
@@ -346,14 +353,15 @@ class Type extends AdminControl {
     /*
      * 删除类型
      */
-    public function type_drop() {
+    public function type_drop()
+    {
         $type_model = model('type');
         $type_id = input('param.type_id');
         if (empty($type_id)) {
             ds_json_encode(10001, lang('param_error'));
         }
         $condition = array();
-        $condition[] = array('type_id','=',$type_id);
+        $condition[] = array('type_id', '=', $type_id);
         //更新前删除对应类型与品牌关联
         $type_model->delTypebrand($condition);
         //更新前删除对应类型与规格关联
@@ -374,7 +382,8 @@ class Type extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'index',
@@ -386,129 +395,134 @@ class Type extends AdminControl {
         if (request()->action() == 'type_add' || request()->action() == 'index') {
             $menu_array[] = array(
                 'name' => 'type_add',
-                'text' => lang('ds_new').lang('type_index_type_name'),
+                'text' => lang('ds_new') . lang('type_index_type_name'),
                 'url' => (string)url('Type/type_add')
             );
         }
         if (request()->action() == 'type_edit') {
             $menu_array[] = array(
                 'name' => 'type_edit',
-                'text' => lang('ds_edit').lang('type_index_type_name'),
+                'text' => lang('ds_edit') . lang('type_index_type_name'),
                 'url' => ''
             );
         }
         return $menu_array;
     }
-    function getSpecRelated($type_id){
+    function getSpecRelated($type_id)
+    {
         //规格关联列表
         $type_model = model('type');
-            $spec_related = $type_model->typeRelatedList('typespec', array('type_id' => $type_id), 'sp_id');
-            $sp_related = array();
-            if (is_array($spec_related) && !empty($spec_related)) {
-                foreach ($spec_related as $val) {
-                    $sp_related[] = $val['sp_id'];
-                }
+        $spec_related = $type_model->typeRelatedList('typespec', array('type_id' => $type_id), 'sp_id');
+        $sp_related = array();
+        if (is_array($spec_related) && !empty($spec_related)) {
+            foreach ($spec_related as $val) {
+                $sp_related[] = $val['sp_id'];
             }
-            unset($spec_related);
-            return $sp_related;
+        }
+        unset($spec_related);
+        return $sp_related;
     }
-    function getBrandRelated($type_id){
+    function getBrandRelated($type_id)
+    {
         //类型与品牌关联列表
         $type_model = model('type');
-            $brand_related = $type_model->typeRelatedList('typebrand', array('type_id' => $type_id), 'brand_id');
-            $b_related = array();
-            if (is_array($brand_related) && !empty($brand_related)) {
-                foreach ($brand_related as $val) {
-                    $b_related[] = $val['brand_id'];
-                }
+        $brand_related = $type_model->typeRelatedList('typebrand', array('type_id' => $type_id), 'brand_id');
+        $b_related = array();
+        if (is_array($brand_related) && !empty($brand_related)) {
+            foreach ($brand_related as $val) {
+                $b_related[] = $val['brand_id'];
             }
-            unset($brand_related);
-            return $b_related;
+        }
+        unset($brand_related);
+        return $b_related;
     }
-    function getSpec($class_id,$type_id=0){
-        
+    function getSpec($class_id, $type_id = 0)
+    {
+
         $goodsclass_model = model('goodsclass');
-        $in_gc_id='0';
+        $in_gc_id = '0';
         //分类是否存在
-        if($class_id && Db::name('goodsclass')->where('gc_id',$class_id)->value('gc_id')){
-            $parent_gc_list=$goodsclass_model->getGoodsclassLineForTag($class_id);
-            if(is_array($parent_gc_list) && !empty($parent_gc_list)){
+        if ($class_id && Db::name('goodsclass')->where('gc_id', $class_id)->value('gc_id')) {
+            $parent_gc_list = $goodsclass_model->getGoodsclassLineForTag($class_id);
+            if (is_array($parent_gc_list) && !empty($parent_gc_list)) {
                 //获取分类的父分类ID
-                if(isset($parent_gc_list['gc_id_1'])){
-                    $in_gc_id.=','.$parent_gc_list['gc_id_1'];
+                if (isset($parent_gc_list['gc_id_1'])) {
+                    $in_gc_id .= ',' . $parent_gc_list['gc_id_1'];
                 }
-                if(isset($parent_gc_list['gc_id_2'])){
-                    $in_gc_id.=','.$parent_gc_list['gc_id_2'];
+                if (isset($parent_gc_list['gc_id_2'])) {
+                    $in_gc_id .= ',' . $parent_gc_list['gc_id_2'];
                 }
-                if(isset($parent_gc_list['gc_id_3'])){
-                    $in_gc_id.=','.$parent_gc_list['gc_id_3'];
+                if (isset($parent_gc_list['gc_id_3'])) {
+                    $in_gc_id .= ',' . $parent_gc_list['gc_id_3'];
                 }
             }
         }
-        
-            //根据相同分类检索出对应的规格
-            $spec_model = model('spec');
-            $condition = array();
-            $condition[]=array('gc_id','in',$in_gc_id);    
-            $spec_list = $spec_model->getSpecList($condition);
-            $s_list = array();
-            $sp_related = array();
-            if($type_id){
-                $sp_related=$this->getSpecRelated($type_id);
-            }
-            if (is_array($spec_list) && !empty($spec_list)) {
-                foreach ($spec_list as $k => $val) {
-                    $val['checked']= in_array($val['sp_id'], $sp_related)?1:0;
-                    $s_list[$val['gc_id']]['spec'][$k] = $val;
-                    $s_list[$val['gc_id']]['name'] = $val['gc_name'];
-                }
+
+        //根据相同分类检索出对应的规格
+        $spec_model = model('spec');
+        $condition = array();
+        $condition[] = array('gc_id', 'in', $in_gc_id);
+        $spec_list = $spec_model->getSpecList($condition);
+        $s_list = array();
+        $sp_related = array();
+        if ($type_id) {
+            $sp_related = $this->getSpecRelated($type_id);
+        }
+        if (is_array($spec_list) && !empty($spec_list)) {
+            foreach ($spec_list as $k => $val) {
+                $val['checked'] = in_array($val['sp_id'], $sp_related) ? 1 : 0;
+                $s_list[$val['gc_id']]['spec'][$k] = $val;
+                $s_list[$val['gc_id']]['name'] = $val['gc_name'];
             }
-            ksort($s_list);
-            return $s_list;
+        }
+        ksort($s_list);
+        return $s_list;
     }
-    function getBrand($class_id,$type_id=0){
+    function getBrand($class_id, $type_id = 0)
+    {
         $goodsclass_model = model('goodsclass');
-        
-        $in_gc_id[]=0;
+
+        $in_gc_id[] = 0;
         //分类是否存在
-        if($class_id && Db::name('goodsclass')->where('gc_id',$class_id)->value('gc_id')){
-            $parent_gc_list=$goodsclass_model->getGoodsclassLineForTag($class_id);
-            if(is_array($parent_gc_list) && !empty($parent_gc_list)){
+        if ($class_id && Db::name('goodsclass')->where('gc_id', $class_id)->value('gc_id')) {
+            $parent_gc_list = $goodsclass_model->getGoodsclassLineForTag($class_id);
+            if (is_array($parent_gc_list) && !empty($parent_gc_list)) {
                 //获取分类的父分类ID
-                if(isset($parent_gc_list['gc_id_1'])){
-                    $in_gc_id[]=$parent_gc_list['gc_id_1'];
+                if (isset($parent_gc_list['gc_id_1'])) {
+                    $in_gc_id[] = $parent_gc_list['gc_id_1'];
                 }
-                if(isset($parent_gc_list['gc_id_2'])){
-                    $in_gc_id[]=$parent_gc_list['gc_id_2'];
+                if (isset($parent_gc_list['gc_id_2'])) {
+                    $in_gc_id[] = $parent_gc_list['gc_id_2'];
                 }
-                if(isset($parent_gc_list['gc_id_3'])){
-                    $in_gc_id[]=$parent_gc_list['gc_id_3'];
+                if (isset($parent_gc_list['gc_id_3'])) {
+                    $in_gc_id[] = $parent_gc_list['gc_id_3'];
                 }
             }
         }
         $brand_model = model('brand');
-            $brand_list = $brand_model->getBrandPassedList(array(array('gc_id','in',$in_gc_id)));
-            $b_list = array();
-            $b_related = array();
-            if($type_id){
-                $b_related=$this->getBrandRelated($type_id);
-            }
-            if (is_array($brand_list) && !empty($brand_list)) {
-                foreach ($brand_list as $k => $val) {
-                    $val['checked']= in_array($val['brand_id'], $b_related)?1:0;
-                    $b_list[$val['gc_id']]['brand'][$k] = $val;
-                    $b_list[$val['gc_id']]['name'] = $val['brand_class'];
-                }
+        $brand_list = $brand_model->getBrandPassedList(array(array('gc_id', 'in', $in_gc_id)));
+        $b_list = array();
+        $b_related = array();
+        if ($type_id) {
+            $b_related = $this->getBrandRelated($type_id);
+        }
+        if (is_array($brand_list) && !empty($brand_list)) {
+            foreach ($brand_list as $k => $val) {
+                $val['checked'] = in_array($val['brand_id'], $b_related) ? 1 : 0;
+                $b_list[$val['gc_id']]['brand'][$k] = $val;
+                $b_list[$val['gc_id']]['name'] = $val['brand_class'];
             }
-            ksort($b_list);
-            return $b_list;
+        }
+        ksort($b_list);
+        return $b_list;
     }
-    function ajaxGetSpecAndBrand(){
-        $class_id=intval(input('class_id'));
-        $type_id=intval(input('type_id'));
-        $s_list=$this->getSpec($class_id,$type_id);
-        $b_list=$this->getBrand($class_id,$type_id);
-        echo json_encode(array('s_list'=>$s_list,'b_list'=>$b_list));
+    function ajaxGetSpecAndBrand()
+    {
+        $class_id = intval(input('class_id'));
+        $type_id = intval(input('type_id'));
+        $s_list = $this->getSpec($class_id, $type_id);
+        $b_list = $this->getBrand($class_id, $type_id);
+        echo json_encode(array('s_list' => $s_list, 'b_list' => $b_list));
         return;
     }
 }

+ 13 - 9
app/admin/controller/Upload.php

@@ -6,23 +6,26 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
-class Upload extends AdminControl {
+class Upload extends AdminControl
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
         Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/upload.lang.php');
     }
 
-    function default_thumb() {
+    function default_thumb()
+    {
         $config_model = model('config');
         $list_config = rkcache('config', true);
 
@@ -116,7 +119,8 @@ class Upload extends AdminControl {
         }
     }
 
-    public function upload_type() {
+    public function upload_type()
+    {
         if (!request()->isPost()) {
             $list_config = rkcache('config', true);
             View::assign('list_config', $list_config);
@@ -136,7 +140,8 @@ class Upload extends AdminControl {
     /**
      * 获取卖家栏目列表,针对控制器下的栏目
      */
-    protected function getAdminItemList() {
+    protected function getAdminItemList()
+    {
         $menu_array = array(
             array(
                 'name' => 'default_thumb', 'text' => lang('default_thumb'), 'url' => (string) url('Upload/default_thumb')
@@ -146,5 +151,4 @@ class Upload extends AdminControl {
         );
         return $menu_array;
     }
-
 }

+ 3 - 3
app/admin/controller/Voucher.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Voucher extends AdminControl

+ 3 - 3
app/admin/controller/Vrgroupbuy.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Vrgroupbuy extends AdminControl

+ 3 - 3
app/admin/controller/Vrorder.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Vrorder extends AdminControl

+ 3 - 3
app/admin/controller/Vrrefund.php

@@ -6,13 +6,13 @@ use think\facade\View;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Vrrefund extends AdminControl

+ 3 - 3
app/admin/controller/Webscan.php

@@ -10,13 +10,13 @@ use think\facade\Lang;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Webscan extends AdminControl

+ 3 - 3
app/admin/controller/Wechat.php

@@ -12,13 +12,13 @@ use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 控制器
  */
 class Wechat extends AdminControl

+ 3 - 3
app/api/controller/Article.php

@@ -5,13 +5,13 @@ namespace app\api\controller;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 文章控制器
  */
 class Article extends MobileMall

+ 3 - 3
app/api/controller/Articleclass.php

@@ -3,13 +3,13 @@
 namespace app\api\controller;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 文章分类控制器
  */
 class Articleclass extends MobileMall

+ 3 - 3
app/api/controller/Bargain.php

@@ -5,13 +5,13 @@ namespace app\api\controller;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 砍价活动控制器
  */
 class Bargain extends MobileMall

+ 3 - 3
app/api/controller/Brand.php

@@ -5,13 +5,13 @@ namespace app\api\controller;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 品牌控制器
  */
 class Brand extends MobileMall

+ 3 - 3
app/api/controller/Chain.php

@@ -5,13 +5,13 @@ namespace app\api\controller;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 附件店铺控制器
  */
 class Chain extends MobileMall

+ 3 - 3
app/api/controller/Connectqq.php

@@ -5,13 +5,13 @@ namespace app\api\controller;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * QQ登录控制器
  */
 class Connectqq extends MobileMall

+ 3 - 3
app/api/controller/Connectsina.php

@@ -5,13 +5,13 @@ namespace app\api\controller;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 微博登录控制器
  */
 class Connectsina extends MobileMall

+ 3 - 3
app/api/controller/Document.php

@@ -4,13 +4,13 @@ namespace app\api\controller;
 
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 平台协议控制器
  */
 class Document extends MobileMall

+ 3 - 3
app/api/controller/Groupbuy.php

@@ -3,13 +3,13 @@
 namespace app\api\controller;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 拼团控制器
  */
 class Groupbuy extends MobileMall

+ 183 - 172
app/api/controller/Index.php

@@ -1,20 +1,24 @@
 <?php
 
 namespace app\api\controller;
+
 use think\facade\Db;
+
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 公共数据控制器
  */
-class Index extends MobileMall {
+class Index extends MobileMall
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
     }
 
@@ -44,55 +48,54 @@ class Index extends MobileMall {
      * @apiSuccess {String} result.editable_page_config_list.editable_page_config_content  配置内容
      
      */
-    public function getEditablePageConfigList() {
-        $store_id=intval(input('param.store_id'));
-        $editable_page_id=intval(input('param.editable_page_id'));
-        $editable_page_path=input('param.editable_page_path');
-        $editable_page_item_id=intval(input('param.editable_page_item_id'));
-        $editable_page_model=model('editable_page');
-        if(!$editable_page_id && !$editable_page_path){
-            ds_json_encode(10001,lang('param_error'));
+    public function getEditablePageConfigList()
+    {
+        $store_id = intval(input('param.store_id'));
+        $editable_page_id = intval(input('param.editable_page_id'));
+        $editable_page_path = input('param.editable_page_path');
+        $editable_page_item_id = intval(input('param.editable_page_item_id'));
+        $editable_page_model = model('editable_page');
+        if (!$editable_page_id && !$editable_page_path) {
+            ds_json_encode(10001, lang('param_error'));
         }
         $condition = array();
-        $condition[] = array('editable_page_client','=','h5');
-        if($editable_page_id){
-            $condition[] = array('editable_page_id','=',$editable_page_id);
-        }else{
-            $condition[] = array('editable_page_path','=',$editable_page_path);
-            $condition[] = array('editable_page_item_id','=',$editable_page_item_id);
+        $condition[] = array('editable_page_client', '=', 'h5');
+        if ($editable_page_id) {
+            $condition[] = array('editable_page_id', '=', $editable_page_id);
+        } else {
+            $condition[] = array('editable_page_path', '=', $editable_page_path);
+            $condition[] = array('editable_page_item_id', '=', $editable_page_item_id);
         }
-        if($store_id){
-            $condition[] = array('store_id','=',$store_id);
+        if ($store_id) {
+            $condition[] = array('store_id', '=', $store_id);
         }
-        $editable_page_config_list=false;
-            $editable_page=$editable_page_model->getOneEditablePage($condition);
-            if($editable_page){
-            $editable_page['editable_page_theme_config']= json_decode($editable_page['editable_page_theme_config'],true);
+        $editable_page_config_list = false;
+        $editable_page = $editable_page_model->getOneEditablePage($condition);
+        if ($editable_page) {
+            $editable_page['editable_page_theme_config'] = json_decode($editable_page['editable_page_theme_config'], true);
 
             $editable_page_config_model = model('editable_page_config');
-            $editable_page_config_list=$editable_page_config_model->getEditablePageConfigList(array(array('editable_page_id', '=', $editable_page['editable_page_id'])));
-            foreach($editable_page_config_list as $key => $val){
-                $config_info=json_decode($val['editable_page_config_content'], true);
-                $model_id=$val['editable_page_model_id'];
-            if(!empty($config_info)){
-                require_once PLUGINS_PATH.'/editable_page_model/h5_'.$model_id.'/config.php';
-                $model_name='Model'.$model_id;
-                $model=new $model_name();
-                $res=$model->filterData($config_info);
-                if($res['code']){
-                    $res=$model->formatData(json_encode($res['data']),$store_id);
-                    if($res['code']){
-                        $editable_page_config_list[$key]['editable_page_config_content']=$res['data'];
+            $editable_page_config_list = $editable_page_config_model->getEditablePageConfigList(array(array('editable_page_id', '=', $editable_page['editable_page_id'])));
+            foreach ($editable_page_config_list as $key => $val) {
+                $config_info = json_decode($val['editable_page_config_content'], true);
+                $model_id = $val['editable_page_model_id'];
+                if (!empty($config_info)) {
+                    require_once PLUGINS_PATH . '/editable_page_model/h5_' . $model_id . '/config.php';
+                    $model_name = 'Model' . $model_id;
+                    $model = new $model_name();
+                    $res = $model->filterData($config_info);
+                    if ($res['code']) {
+                        $res = $model->formatData(json_encode($res['data']), $store_id);
+                        if ($res['code']) {
+                            $editable_page_config_list[$key]['editable_page_config_content'] = $res['data'];
+                        }
                     }
                 }
-                
-            }
-      
             }
-            }
-        ds_json_encode(10000, '', array('editable_page_config_list' =>$editable_page_config_list ,'editable_page'=>$editable_page));
+        }
+        ds_json_encode(10000, '', array('editable_page_config_list' => $editable_page_config_list, 'editable_page' => $editable_page));
     }
-    
+
     /**
      * @api {POST} api/Index/search_key_list 默认搜索词列表
      * @apiVersion 1.0.0
@@ -104,7 +107,8 @@ class Index extends MobileMall {
      * @apiSuccess {String[]} result.list  热门搜索列表
      * @apiSuccess {String[]} result.his_list  历史搜索列表
      */
-    public function search_key_list() {
+    public function search_key_list()
+    {
         $list = @explode(',', config('ds_config.hot_search'));
         if (!$list || !is_array($list)) {
             $list = array();
@@ -142,7 +146,8 @@ class Index extends MobileMall {
      * @apiSuccess {Int} result.ad_list.adv_sort  广告图排序
      * @apiSuccess {Int} result.ad_list.adv_enabled  是否开启广告图 1是0否
      */
-    public function getAppadList() {
+    public function getAppadList()
+    {
         $ap_id = intval(input('param.ap_id'));
         if ($ap_id <= 0) {
             ds_json_encode(10001, lang('param_error'));
@@ -151,10 +156,10 @@ class Index extends MobileMall {
         $result = rcache($ap_id, $prefix);
         if (empty($result)) {
             $condition = array();
-            $condition[] = array('ap_id','=',$ap_id);
-            $condition[] = array('adv_enabled','=',1);
-			$condition[] = array('adv_startdate','<',TIMESTAMP);
-			$condition[] = array('adv_enddate','>',TIMESTAMP);
+            $condition[] = array('ap_id', '=', $ap_id);
+            $condition[] = array('adv_enabled', '=', 1);
+            $condition[] = array('adv_startdate', '<', TIMESTAMP);
+            $condition[] = array('adv_enddate', '>', TIMESTAMP);
             $ad_list = model('appadv')->getAppadvList($condition);
             if (!empty($ad_list)) {
                 foreach ($ad_list as $key => $banner) {
@@ -220,16 +225,17 @@ class Index extends MobileMall {
      * @apiSuccess {Int} result.floor_ads.adv_sort  广告图排序
      * @apiSuccess {Int} result.floor_ads.adv_enabled  是否开启广告图 1是0否
      */
-    public function getIndexAdList() {
+    public function getIndexAdList()
+    {
         $cache_key = "api-getIndexAdList";
         $result = rcache($cache_key);
         if (empty($result)) {
             $condition = array();
-            $condition[] = array('adv_enabled','=',1);
+            $condition[] = array('adv_enabled', '=', 1);
             // 首页轮播图
-            $condition[] = array('ap_id','=',1);
-			$condition[] = array('adv_startdate','<',TIMESTAMP);
-			$condition[] = array('adv_enddate','>',TIMESTAMP);
+            $condition[] = array('ap_id', '=', 1);
+            $condition[] = array('adv_startdate', '<', TIMESTAMP);
+            $condition[] = array('adv_enddate', '>', TIMESTAMP);
             $banners_list = model('appadv')->getAppadvList($condition);
             if (!empty($banners_list)) {
                 foreach ($banners_list as $key => $banner) {
@@ -240,10 +246,10 @@ class Index extends MobileMall {
 
             // 首页促销
             $condition = array();
-            $condition[] = array('adv_enabled','=',1);
-            $condition[] = array('ap_id','=',2);
-			$condition[] = array('adv_startdate','<',TIMESTAMP);
-			$condition[] = array('adv_enddate','>',TIMESTAMP);
+            $condition[] = array('adv_enabled', '=', 1);
+            $condition[] = array('ap_id', '=', 2);
+            $condition[] = array('adv_startdate', '<', TIMESTAMP);
+            $condition[] = array('adv_enddate', '>', TIMESTAMP);
             $promotion_ads = model('appadv')->getAppadvList($condition);
             if (!empty($promotion_ads)) {
                 foreach ($promotion_ads as $key => $banner) {
@@ -254,10 +260,10 @@ class Index extends MobileMall {
 
             // 首页Navs
             $condition = array();
-            $condition[] = array('adv_enabled','=',1);
-            $condition[] = array('ap_id','=',3);
-			$condition[] = array('adv_startdate','<',TIMESTAMP);
-			$condition[] = array('adv_enddate','>',TIMESTAMP);
+            $condition[] = array('adv_enabled', '=', 1);
+            $condition[] = array('ap_id', '=', 3);
+            $condition[] = array('adv_startdate', '<', TIMESTAMP);
+            $condition[] = array('adv_enddate', '>', TIMESTAMP);
             $navs_list = model('appadv')->getAppadvList($condition);
             if (!empty($navs_list)) {
                 foreach ($navs_list as $key => $banner) {
@@ -268,10 +274,10 @@ class Index extends MobileMall {
 
             // 首页横图广告
             $condition = array();
-            $condition[] = array('adv_enabled','=',1);
-            $condition[] = array('ap_id','=',4);
-			$condition[] = array('adv_startdate','<',TIMESTAMP);
-			$condition[] = array('adv_enddate','>',TIMESTAMP);
+            $condition[] = array('adv_enabled', '=', 1);
+            $condition[] = array('ap_id', '=', 4);
+            $condition[] = array('adv_startdate', '<', TIMESTAMP);
+            $condition[] = array('adv_enddate', '>', TIMESTAMP);
             $floor_ads = model('appadv')->getAppadvList($condition);
             if (!empty($floor_ads)) {
                 foreach ($floor_ads as $key => $banner) {
@@ -311,52 +317,53 @@ class Index extends MobileMall {
      * @apiSuccess {String} result.config_list.points_signin_cycle  签到持续周期
      * @apiSuccess {String} result.config_list.points_signin_reward  签到持续周期额外奖励
      */
-    public function getConfigList() {
+    public function getConfigList()
+    {
         $list_config = rkcache('config', true);
-        $wechat_model=model('wechat');
+        $wechat_model = model('wechat');
         $wx_config = $wechat_model->getOneWxconfig();
-        if(!empty($list_config['business_licence'])){
-            $list_config['business_licence'] = ds_get_pic( ATTACH_COMMON , $list_config['business_licence']);
+        if (!empty($list_config['business_licence'])) {
+            $list_config['business_licence'] = ds_get_pic(ATTACH_COMMON, $list_config['business_licence']);
         }
         $config_list = array(
-            'site_name' => $list_config['site_name'], 
-            'site_mobile_logo' => ds_get_pic(ATTACH_COMMON , $list_config['site_mobile_logo']),
-            'member_auth'=>$list_config['member_auth'],
-            'instant_message_gateway_url'=>$list_config['instant_message_gateway_url'], //站内IM服务器地址
-            'instant_message_open'=>$list_config['instant_message_open'], //是否启用im
-            'qq_isuse'=>$list_config['qq_isuse'], //是否使用QQ互联
-            'sina_isuse'=>$list_config['sina_isuse'], //是否使用微博互联
-            'weixin_isuse'=>$list_config['weixin_isuse'], //是否使用微信互联
-            'member_normal_register'=>$list_config['member_normal_register'], //是否普通注册
-            'sms_register'=>$list_config['sms_register'], //是否手机注册
-            'sms_login'=>$list_config['sms_login'], //是否手机登录
-            'mapak_type'=>$list_config['mapak_type'], //地图类型
-			'gaode_ak'=>$list_config['gaode_ak'], //高德地图AK密钥
-			'gaode_jscode'=>$list_config['gaode_jscode'], //高德地图安全密钥
-			'baidu_ak'=>$list_config['baidu_ak'], //百度浏览器端地图AK密钥
-			'baiduservice_ak'=>$list_config['baiduservice_ak'], //百度服务端地图AK密钥
-            'inviter_open'=>$list_config['inviter_open'], //推广开关
-            'inviter_level'=>$list_config['inviter_level'], //推广级别
-            'inviter_show'=>$list_config['inviter_show'], //详情页显示推广佣金
-            'inviter_return'=>$list_config['inviter_return'], //推广员返佣
-            'inviter_view'=>$list_config['inviter_view'], //推广员审核
-            'business_licence'=>$list_config['business_licence'], //营业执照,
-            'points_isuse'=>$list_config['points_isuse'], //是否开启积分
-            'points_signin_isuse'=>$list_config['points_signin_isuse'], //是否开启签到送积分
-            'points_signin_cycle'=>$list_config['points_signin_cycle'], //签到持续周期
-            'points_signin_reward'=>$list_config['points_signin_reward'], //签到持续周期额外奖励
-            'wechat_appid'=>!empty($wx_config)?$wx_config['appid']:'', //微信appid
-            'captcha_status_register'=>$list_config['captcha_status_register'], //注册验证码
-            'captcha_status_login'=>$list_config['captcha_status_login'], //登录验证码
-            'captcha_status_goodsqa'=>$list_config['captcha_status_goodsqa'], //咨询验证码
-            'store_joinin_open'=>$list_config['store_joinin_open'], //店铺入驻开启
-            'flow_static_code'=>$list_config['flow_static_code'], //版权信息
-            'video_type'=>$list_config['video_type'], //视频服务商
-            'aliyun_user_id'=>$list_config['aliyun_user_id'], //版权信息
-            'live_type'=>$list_config['live_type'], //直播类型
-            'chain_isuse'=>$list_config['chain_isuse'], //代收是否开启
-            'wab_number'=>$list_config['wab_number'], //网安备
-            'icp_number'=>$list_config['icp_number'], //ICP
+            'site_name' => $list_config['site_name'],
+            'site_mobile_logo' => ds_get_pic(ATTACH_COMMON, $list_config['site_mobile_logo']),
+            'member_auth' => $list_config['member_auth'],
+            'instant_message_gateway_url' => $list_config['instant_message_gateway_url'], //站内IM服务器地址
+            'instant_message_open' => $list_config['instant_message_open'], //是否启用im
+            'qq_isuse' => $list_config['qq_isuse'], //是否使用QQ互联
+            'sina_isuse' => $list_config['sina_isuse'], //是否使用微博互联
+            'weixin_isuse' => $list_config['weixin_isuse'], //是否使用微信互联
+            'member_normal_register' => $list_config['member_normal_register'], //是否普通注册
+            'sms_register' => $list_config['sms_register'], //是否手机注册
+            'sms_login' => $list_config['sms_login'], //是否手机登录
+            'mapak_type' => $list_config['mapak_type'], //地图类型
+            'gaode_ak' => $list_config['gaode_ak'], //高德地图AK密钥
+            'gaode_jscode' => $list_config['gaode_jscode'], //高德地图安全密钥
+            'baidu_ak' => $list_config['baidu_ak'], //百度浏览器端地图AK密钥
+            'baiduservice_ak' => $list_config['baiduservice_ak'], //百度服务端地图AK密钥
+            'inviter_open' => $list_config['inviter_open'], //推广开关
+            'inviter_level' => $list_config['inviter_level'], //推广级别
+            'inviter_show' => $list_config['inviter_show'], //详情页显示推广佣金
+            'inviter_return' => $list_config['inviter_return'], //推广员返佣
+            'inviter_view' => $list_config['inviter_view'], //推广员审核
+            'business_licence' => $list_config['business_licence'], //营业执照,
+            'points_isuse' => $list_config['points_isuse'], //是否开启积分
+            'points_signin_isuse' => $list_config['points_signin_isuse'], //是否开启签到送积分
+            'points_signin_cycle' => $list_config['points_signin_cycle'], //签到持续周期
+            'points_signin_reward' => $list_config['points_signin_reward'], //签到持续周期额外奖励
+            'wechat_appid' => !empty($wx_config) ? $wx_config['appid'] : '', //微信appid
+            'captcha_status_register' => $list_config['captcha_status_register'], //注册验证码
+            'captcha_status_login' => $list_config['captcha_status_login'], //登录验证码
+            'captcha_status_goodsqa' => $list_config['captcha_status_goodsqa'], //咨询验证码
+            'store_joinin_open' => $list_config['store_joinin_open'], //店铺入驻开启
+            'flow_static_code' => $list_config['flow_static_code'], //版权信息
+            'video_type' => $list_config['video_type'], //视频服务商
+            'aliyun_user_id' => $list_config['aliyun_user_id'], //版权信息
+            'live_type' => $list_config['live_type'], //直播类型
+            'chain_isuse' => $list_config['chain_isuse'], //代收是否开启
+            'wab_number' => $list_config['wab_number'], //网安备
+            'icp_number' => $list_config['icp_number'], //ICP
         );
         ds_json_encode(10000, '', array('config_list' => $config_list));
     }
@@ -430,7 +437,8 @@ class Index extends MobileMall {
      * @apiSuccess {Int} result.good_products.store_id  店铺ID
      * @apiSuccess {String} result.good_products.store_name  店铺名称
      */
-    public function getProductList() {
+    public function getProductList()
+    {
         $cache_key = "api-getProductList";
         $result = rcache($cache_key);
         if (empty($result)) {
@@ -439,14 +447,14 @@ class Index extends MobileMall {
             $fieldstr = "goods.goods_id,goods.goods_storage,goodscommon.goods_commonid,goodscommon.store_id,goodscommon.goods_name,goodscommon.goods_advword,goodscommon.goods_price,goods.goods_promotion_price,goods.goods_promotion_type,goodscommon.goods_marketprice,goodscommon.goods_image,goods.goods_salenum,goods.evaluation_good_star,goods.evaluation_count";
             $fieldstr .= ',goodscommon.is_virtual,goodscommon.is_goodsfcode,goods.is_have_gift,goodscommon.store_name,goodscommon.is_platform_store';
 
-            $hot_products = $goods_model->getGoodsUnionList(array(),$fieldstr , 'goods_salenum desc','goodscommon.goods_commonid', $this->pagesize);
+            $hot_products = $goods_model->getGoodsUnionList(array(), $fieldstr, 'goods_salenum desc', 'goodscommon.goods_commonid', $this->pagesize);
             if ($hot_products) {
                 foreach ($hot_products as $key => $val) {
-                    if(!$val['goods_storage']){
-                        $goods_info=$goods_model->getGoodsStorageByCommonId($val['goods_commonid']);
-                        if($goods_info){
-                            $hot_products[$key]['goods_id']=$goods_info['goods_id'];
-                            $hot_products[$key]['goods_promotion_price']=$goods_info['goods_promotion_price'];
+                    if (!$val['goods_storage']) {
+                        $goods_info = $goods_model->getGoodsStorageByCommonId($val['goods_commonid']);
+                        if ($goods_info) {
+                            $hot_products[$key]['goods_id'] = $goods_info['goods_id'];
+                            $hot_products[$key]['goods_promotion_price'] = $goods_info['goods_promotion_price'];
                         }
                     }
                     $hot_products[$key]['goods_img_480'] = goods_thumb($val, 480);
@@ -454,14 +462,14 @@ class Index extends MobileMall {
             }
             $result['hot_products'] = $hot_products;
 
-            $recently_products = $goods_model->getGoodsUnionList(array(),$fieldstr , 'goods_edittime desc','goodscommon.goods_commonid', $this->pagesize);
+            $recently_products = $goods_model->getGoodsUnionList(array(), $fieldstr, 'goods_edittime desc', 'goodscommon.goods_commonid', $this->pagesize);
             if ($recently_products) {
                 foreach ($recently_products as $key => $val) {
-                    if(!$val['goods_storage']){
-                        $goods_info=$goods_model->getGoodsStorageByCommonId($val['goods_commonid']);
-                        if($goods_info){
-                            $recently_products[$key]['goods_id']=$goods_info['goods_id'];
-                            $recently_products[$key]['goods_promotion_price']=$goods_info['goods_promotion_price'];
+                    if (!$val['goods_storage']) {
+                        $goods_info = $goods_model->getGoodsStorageByCommonId($val['goods_commonid']);
+                        if ($goods_info) {
+                            $recently_products[$key]['goods_id'] = $goods_info['goods_id'];
+                            $recently_products[$key]['goods_promotion_price'] = $goods_info['goods_promotion_price'];
                         }
                     }
                     $recently_products[$key]['goods_img_480'] = goods_thumb($val, 480);
@@ -469,36 +477,36 @@ class Index extends MobileMall {
             }
             $result['recently_products'] = $recently_products;
 
-            
-            $good_products = $goods_model->getGoodsUnionList(array(array('goodscommon.mall_goods_commend','=',1)),$fieldstr , 'goodscommon.mall_goods_sort asc','goodscommon.goods_commonid', $this->pagesize);
+
+            $good_products = $goods_model->getGoodsUnionList(array(array('goodscommon.mall_goods_commend', '=', 1)), $fieldstr, 'goodscommon.mall_goods_sort asc', 'goodscommon.goods_commonid', $this->pagesize);
             if ($good_products) {
                 foreach ($good_products as $key => $val) {
-                    if(!$val['goods_storage']){
-                        $goods_info=$goods_model->getGoodsStorageByCommonId($val['goods_commonid']);
-                        if($goods_info){
-                            $good_products[$key]['goods_id']=$goods_info['goods_id'];
-                            $good_products[$key]['goods_promotion_price']=$goods_info['goods_promotion_price'];
+                    if (!$val['goods_storage']) {
+                        $goods_info = $goods_model->getGoodsStorageByCommonId($val['goods_commonid']);
+                        if ($goods_info) {
+                            $good_products[$key]['goods_id'] = $goods_info['goods_id'];
+                            $good_products[$key]['goods_promotion_price'] = $goods_info['goods_promotion_price'];
                         }
                     }
                     $good_products[$key]['goods_img_480'] = goods_thumb($val, 480);
                 }
             }
             $result['good_products'] = $good_products;
-			
-			//秒杀
-			$xianshicondition = array(
-				array('xianshigoods_state', '=', 1),
-				array('xianshigoods_starttime', '<', TIMESTAMP),
-				array('xianshigoods_end_time', '>', TIMESTAMP),
-			);
-			
-			$xianshi = model('pxianshigoods')->getXianshigoodsList($xianshicondition,null,'','*',3);
-			foreach ($xianshi as $k => $v){
-				$price_array = explode(".", $v['xianshigoods_price']);
-				$xianshi[$k]['goods_image'] = goods_cthumb($v['goods_image'], 480);
-				$xianshi[$k]['xianshigoods_end_time'] = date("m-d H:i", $v['xianshigoods_end_time']);
-			}
-			$result['xianshi_products'] = $xianshi;
+
+            //秒杀
+            $xianshicondition = array(
+                array('xianshigoods_state', '=', 1),
+                array('xianshigoods_starttime', '<', TIMESTAMP),
+                array('xianshigoods_end_time', '>', TIMESTAMP),
+            );
+
+            $xianshi = model('pxianshigoods')->getXianshigoodsList($xianshicondition, null, '', '*', 3);
+            foreach ($xianshi as $k => $v) {
+                $price_array = explode(".", $v['xianshigoods_price']);
+                $xianshi[$k]['goods_image'] = goods_cthumb($v['goods_image'], 480);
+                $xianshi[$k]['xianshigoods_end_time'] = date("m-d H:i", $v['xianshigoods_end_time']);
+            }
+            $result['xianshi_products'] = $xianshi;
             wcache($cache_key, $result);
         }
 
@@ -521,18 +529,19 @@ class Index extends MobileMall {
      * @apiSuccess {String} result.signPackage.signature  微信签名
      * @apiSuccess {String} result.signPackage.rawString  原始数据
      */
-    public function getWechatShare(){
-        $wechat_model=model('wechat');
+    public function getWechatShare()
+    {
+        $wechat_model = model('wechat');
         $wechat_model->getOneWxconfig();
         $signPackage = $wechat_model->GetSignPackage(urldecode(input('param.url')));
-    	$goods_detail['signPackage']=$signPackage;
-        if($wechat_model->error_code){
-            ds_json_encode(10001,$wechat_model->error_message);
-        }else{
+        $goods_detail['signPackage'] = $signPackage;
+        if ($wechat_model->error_code) {
+            ds_json_encode(10001, $wechat_model->error_message);
+        } else {
             ds_json_encode(10000, '', array('signPackage' => $signPackage));
         }
     }
-    
+
     /**
      * @api {POST} api/Index/getQrcode 获取二维码
      * @apiVersion 1.0.0
@@ -543,15 +552,16 @@ class Index extends MobileMall {
      * @apiSuccess {String} message  返回消息
      * @apiSuccess {Object} result  返回数据
      */
-    public function getQrcode() {
-        include_once root_path(). 'extend/qrcode/phpqrcode.php';
+    public function getQrcode()
+    {
+        include_once root_path() . 'extend/qrcode/phpqrcode.php';
         $value = strip_tags(htmlspecialchars_decode(input('get.url')));
         $errorCorrectionLevel = "L";
         $matrixPointSize = "4";
-        \QRcode::png($value, false, $errorCorrectionLevel, $matrixPointSize,2);
+        \QRcode::png($value, false, $errorCorrectionLevel, $matrixPointSize, 2);
         exit;
     }
-    
+
     /**
      * @api {POST} api/Index/getGuessLike 猜你喜欢
      * @apiVersion 1.0.0
@@ -562,30 +572,31 @@ class Index extends MobileMall {
      * @apiSuccess {String} message  返回消息
      * @apiSuccess {Object} result  返回数据
      */
-    public function getGuessLike(){
-        $member_id=intval(input('param.member_id'));
+    public function getGuessLike()
+    {
+        $member_id = intval(input('param.member_id'));
         $goods_list = model('goodsbrowse')->getGuessLikeGoods($member_id, 20);
         if ($goods_list) {
             foreach ($goods_list as $key => $val) {
                 $goods_list[$key]['goods_img_480'] = goods_thumb($val, 480);
             }
         }
-        if(empty($goods_list)){//随机请求
-            $max_id=Db::name('goods')->where(array(array('goods_state','=',1),array('goods_verify','=',1)))->max('goods_commonid');
-            if($max_id){
-                $goods_model=model('goods');
-                $goods_commonids=array();
-                for($i=0;$i<20;$i++){
-                    $condition=array();
-                    $condition[]=array('goods_state','=',1);
-                    $condition[]=array('goods_verify','=',1);
-                    $rand_id=rand(1,$max_id);
-                    $condition[]=array('goods_commonid','>=',$rand_id);
-                    $goods=$goods_model->getGoodsInfo($condition);
-                    if($goods && !in_array($goods['goods_commonid'],$goods_commonids)){
-                        $goods_commonids[]=$goods['goods_commonid'];
+        if (empty($goods_list)) { //随机请求
+            $max_id = Db::name('goods')->where(array(array('goods_state', '=', 1), array('goods_verify', '=', 1)))->max('goods_commonid');
+            if ($max_id) {
+                $goods_model = model('goods');
+                $goods_commonids = array();
+                for ($i = 0; $i < 20; $i++) {
+                    $condition = array();
+                    $condition[] = array('goods_state', '=', 1);
+                    $condition[] = array('goods_verify', '=', 1);
+                    $rand_id = rand(1, $max_id);
+                    $condition[] = array('goods_commonid', '>=', $rand_id);
+                    $goods = $goods_model->getGoodsInfo($condition);
+                    if ($goods && !in_array($goods['goods_commonid'], $goods_commonids)) {
+                        $goods_commonids[] = $goods['goods_commonid'];
                         $goods['goods_img_480'] = goods_thumb($goods, 480);
-                        $goods_list[]=$goods;
+                        $goods_list[] = $goods;
                     }
                     $i++;
                 }

+ 3 - 3
app/api/controller/Inviterpro.php

@@ -5,13 +5,13 @@ namespace app\api\controller;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 分销商品控制器
  */
 class Inviterpro extends MobileMall

+ 31 - 28
app/api/controller/Live.php

@@ -5,18 +5,20 @@ namespace app\api\controller;
 use think\facade\Db;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 公共数据控制器
  */
-class Live extends MobileMall {
+class Live extends MobileMall
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
     }
 
@@ -45,7 +47,8 @@ class Live extends MobileMall {
      * @apiSuccess {String} result.live_apply_list.gc_name  直播商品分类名称
      * @apiSuccess {Object[]} result.live_apply_list.goods_list  直播商品列表
      */
-    public function get_live_list() {
+    public function get_live_list()
+    {
         $condition = array();
         $condition[] = array('live_apply_state', '=', 1);
         $condition[] = array('live_apply_end_time', '>', TIMESTAMP);
@@ -54,7 +57,7 @@ class Live extends MobileMall {
         $cache_key = 'api-member-live';
         $temp = rcache($cache_key);
         if (empty($temp)) {
-            $gc_id_array = Db::name('live_apply_goods')->alias('live_apply_goods')->join('live_apply live_apply','live_apply.live_apply_id=live_apply_goods.live_apply_id')->distinct(true)->where($condition)->column('gc_id_1');
+            $gc_id_array = Db::name('live_apply_goods')->alias('live_apply_goods')->join('live_apply live_apply', 'live_apply.live_apply_id=live_apply_goods.live_apply_id')->distinct(true)->where($condition)->column('gc_id_1');
             $goodsclass_list = array();
             $live_apply_ids = array();
             foreach ($gc_id_array as $v) {
@@ -74,12 +77,12 @@ class Live extends MobileMall {
         $keyword = input('param.keyword');
         $goods_model = model('goods');
         $live_apply_model = model('live_apply');
-        
+
         if ($gc_id > 0) {
             $condition[] = array('live_apply_id', 'in', isset($live_apply_ids[$gc_id]) ? $live_apply_ids[$gc_id] : array());
         }
         if ($keyword) {
-            $condition[] = array('live_apply_id', 'in', Db::name('live_apply_goods')->distinct(true)->where(array(array('store_name|goods_name|gc_name', 'like', '%'.$keyword.'%')))->column('live_apply_id'));
+            $condition[] = array('live_apply_id', 'in', Db::name('live_apply_goods')->distinct(true)->where(array(array('store_name|goods_name|gc_name', 'like', '%' . $keyword . '%')))->column('live_apply_id'));
         }
         $live_apply_list = $live_apply_model->getLiveApplyList($condition);
         $store_model = model('store');
@@ -95,11 +98,11 @@ class Live extends MobileMall {
                 $live_apply_list[$key]['area_info'] = $store_info['area_info'];
             }
 
-            $live_apply_list[$key]['live_apply_cover_image_url'] = ds_get_pic(ATTACH_COMMON,config('ds_config.default_goods_image'));
+            $live_apply_list[$key]['live_apply_cover_image_url'] = ds_get_pic(ATTACH_COMMON, config('ds_config.default_goods_image'));
             if ($val['live_apply_cover_video']) {
-                $live_apply_list[$key]['live_apply_cover_video_url'] = ds_get_pic( ATTACH_LIVE_APPLY . '/' . $val['live_apply_user_id'] , $val['live_apply_cover_video']);
+                $live_apply_list[$key]['live_apply_cover_video_url'] = ds_get_pic(ATTACH_LIVE_APPLY . '/' . $val['live_apply_user_id'], $val['live_apply_cover_video']);
             } elseif ($val['live_apply_cover_image']) {
-                $live_apply_list[$key]['live_apply_cover_image_url'] = ds_get_pic( ATTACH_LIVE_APPLY . '/' . $val['live_apply_user_id'] , $val['live_apply_cover_image']);
+                $live_apply_list[$key]['live_apply_cover_image_url'] = ds_get_pic(ATTACH_LIVE_APPLY . '/' . $val['live_apply_user_id'], $val['live_apply_cover_image']);
             }
 
             $live_apply_goods_list = $live_apply_model->getLiveApplyGoodsList(array(array('live_apply_id', '=', $val['live_apply_id'])));
@@ -128,8 +131,9 @@ class Live extends MobileMall {
         $result = array_merge($result, mobile_page(is_object($live_apply_model->page_info) ? $live_apply_model->page_info : ''));
         ds_json_encode(10000, '', $result);
     }
-    
-    public function get_minipro_live_list() {
+
+    public function get_minipro_live_list()
+    {
         $condition = array();
         $condition[] = array('minipro_live_end_time', '>', TIMESTAMP);
         $goodsclass_model = model('goodsclass');
@@ -137,7 +141,7 @@ class Live extends MobileMall {
         $cache_key = 'api-member-minipro-live';
         $temp = rcache($cache_key);
         if (empty($temp)) {
-            $gc_id_array = Db::name('minipro_live_room_goods')->alias('minipro_live_room_goods')->join('minipro_live minipro_live','minipro_live.minipro_live_id=minipro_live_room_goods.minipro_live_id')->distinct(true)->where($condition)->column('gc_id_1');
+            $gc_id_array = Db::name('minipro_live_room_goods')->alias('minipro_live_room_goods')->join('minipro_live minipro_live', 'minipro_live.minipro_live_id=minipro_live_room_goods.minipro_live_id')->distinct(true)->where($condition)->column('gc_id_1');
             $goodsclass_list = array();
             $minipro_live_ids = array();
             foreach ($gc_id_array as $v) {
@@ -157,30 +161,30 @@ class Live extends MobileMall {
         $keyword = input('param.keyword');
         $goods_model = model('goods');
         $minipro_live_model = model('minipro_live');
-        
+
         if ($gc_id > 0) {
             $condition[] = array('minipro_live_id', 'in', isset($minipro_live_ids[$gc_id]) ? $minipro_live_ids[$gc_id] : array());
         }
         if ($keyword) {
-            $condition[] = array('minipro_live_id', 'in', Db::name('minipro_live_room_goods')->distinct(true)->where(array(array('store_name|goods_name|gc_name', 'like', '%'.$keyword.'%')))->column('minipro_live_id'));
+            $condition[] = array('minipro_live_id', 'in', Db::name('minipro_live_room_goods')->distinct(true)->where(array(array('store_name|goods_name|gc_name', 'like', '%' . $keyword . '%')))->column('minipro_live_id'));
         }
         $minipro_live_list = $minipro_live_model->getMiniproLiveList($condition);
         $store_model = model('store');
-        $minipro_live_room_goods_model=model('minipro_live_room_goods');
+        $minipro_live_room_goods_model = model('minipro_live_room_goods');
         foreach ($minipro_live_list as $key => $val) {
-                $store_info = $store_model->getStoreInfoByID($val['store_id']);
-                if (!$store_info) {
-                    unset($minipro_live_list[$key]);
-                    continue;
-                }
-                $minipro_live_list[$key]['store_name'] = $store_info['store_name'];
-                $minipro_live_list[$key]['store_avatar'] = get_store_logo($store_info['store_avatar']);
-                $minipro_live_list[$key]['area_info'] = $store_info['area_info'];
+            $store_info = $store_model->getStoreInfoByID($val['store_id']);
+            if (!$store_info) {
+                unset($minipro_live_list[$key]);
+                continue;
+            }
+            $minipro_live_list[$key]['store_name'] = $store_info['store_name'];
+            $minipro_live_list[$key]['store_avatar'] = get_store_logo($store_info['store_avatar']);
+            $minipro_live_list[$key]['area_info'] = $store_info['area_info'];
 
 
 
             $minipro_live_room_goods_list = $minipro_live_room_goods_model->getMiniproLiveRoomGoodsList(array(array('minipro_live_id', '=', $val['minipro_live_id'])));
-            $minipro_live_list[$key]['minipro_live_image_url'] = ds_get_pic( ATTACH_MINIPRO_LIVE , $val['minipro_live_image']);
+            $minipro_live_list[$key]['minipro_live_image_url'] = ds_get_pic(ATTACH_MINIPRO_LIVE, $val['minipro_live_image']);
             $minipro_live_list[$key]['goods_count'] = count($minipro_live_room_goods_list);
             $minipro_live_list[$key]['gc_name'] = '';
             $minipro_live_list[$key]['goods_list'] = array();
@@ -206,5 +210,4 @@ class Live extends MobileMall {
         $result = array_merge($result, mobile_page(is_object($minipro_live_model->page_info) ? $minipro_live_model->page_info : ''));
         ds_json_encode(10000, '', $result);
     }
-
 }

+ 3 - 3
app/api/controller/Logout.php

@@ -3,13 +3,13 @@
 namespace app\api\controller;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 登出控制器
  */
 class Logout extends MobileMember

+ 3 - 3
app/api/controller/Marketmanage.php

@@ -5,13 +5,13 @@ namespace app\api\controller;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 营销活动控制器
  */
 class Marketmanage extends MobileMall

+ 32 - 20
app/api/controller/Member.php

@@ -5,18 +5,20 @@ namespace app\api\controller;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 用户控制器
  */
-class Member extends MobileMember {
+class Member extends MobileMember
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
         Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/member_auth.lang.php');
         Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/goods.lang.php');
@@ -90,7 +92,8 @@ class Member extends MobileMember {
      * @apiSuccess {String} result.member_info.member_signin_days_total  签到总天数
      * @apiSuccess {String} result.member_info.member_signin_days_series  持续签到天数总数,非连续周期清零
      */
-    public function index() {
+    public function index()
+    {
         $member_model = model('member');
         $member_info = $member_model->getMemberInfoByID($this->member_info['member_id']);
 
@@ -138,7 +141,8 @@ class Member extends MobileMember {
         ds_json_encode(10000, '', array('member_info' => $member_info));
     }
 
-    public function my_asset() {
+    public function my_asset()
+    {
         $fields_arr = array('point', 'predepoit', 'available_rc_balance', 'voucher');
         $fields_str = trim(input('fields'));
         if ($fields_str) {
@@ -213,7 +217,8 @@ class Member extends MobileMember {
      * @apiSuccess {String} result.member_info.member_wxopenid  微信openid
      * @apiSuccess {String} result.member_info.member_wxunionid  微信unionid
      */
-    public function information() {
+    public function information()
+    {
         $member_model = model('member');
         $condition = array();
         $condition[] = array('member_id', '=', $this->member_info['member_id']);
@@ -222,7 +227,7 @@ class Member extends MobileMember {
         $member_info['member_idcard_image1_url'] = get_member_idcard_image($member_info['member_idcard_image1']);
         $member_info['member_idcard_image2_url'] = get_member_idcard_image($member_info['member_idcard_image2']);
         $member_info['member_idcard_image3_url'] = get_member_idcard_image($member_info['member_idcard_image3']);
-        $member_info['member_birthday'] = date('Y-m-d',$member_info['member_birthday']);
+        $member_info['member_birthday'] = date('Y-m-d', $member_info['member_birthday']);
         unset($member_info['member_password']);
         unset($member_info['member_paypwd']);
         ds_json_encode(10000, '', array('member_info' => $member_info));
@@ -243,7 +248,8 @@ class Member extends MobileMember {
      * @apiSuccess {String} code 返回码,10000为成功
      * @apiSuccess {String} message  返回消息
      */
-    public function edit_information() {
+    public function edit_information()
+    {
         $data = array(
             'member_nickname' => input('param.member_nickname'),
             'member_qq' => input('param.member_qq'),
@@ -280,7 +286,8 @@ class Member extends MobileMember {
      * @apiSuccess {String} message  返回消息
      * @apiSuccess {String} result  用户头像
      */
-    public function edit_memberavatar() {
+    public function edit_memberavatar()
+    {
         $file = request()->file('memberavatar');
         $upload_file = BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_AVATAR . DIRECTORY_SEPARATOR;
         $avatar_name = 'avatar_' . $this->member_info['member_id'] . '.jpg';
@@ -288,7 +295,7 @@ class Member extends MobileMember {
         $res = ds_upload_pic(ATTACH_AVATAR, 'memberavatar', $avatar_name);
         if ($res['code']) {
             $file_name = $res['data']['file_name'];
-            if(file_exists($upload_file . '/' . $avatar_name)){
+            if (file_exists($upload_file . '/' . $avatar_name)) {
                 //生成缩略图
                 $image = \think\Image::open($upload_file . '/' . $avatar_name);
                 $image->thumb(100, 100, \think\Image::THUMB_CENTER)->save($upload_file . '/' . $avatar_name);
@@ -296,14 +303,15 @@ class Member extends MobileMember {
             $member_model = model('member');
             $condition = array();
             $condition[] = array('member_id', '=', $this->member_info['member_id']);
-            $result = $member_model->editMember($condition, array('member_avatar'=>$file_name), $this->member_info['member_id']);
+            $result = $member_model->editMember($condition, array('member_avatar' => $file_name), $this->member_info['member_id']);
             ds_json_encode(10000, '', get_member_avatar($file_name));
         } else {
             ds_json_encode(10001, $res['msg']);
         }
     }
 
-    public function goods_poster() {
+    public function goods_poster()
+    {
         $goods_id = intval(input('param.goods_id'));
         if (!$goods_id) {
             ds_json_encode(10001, lang('param_error'));
@@ -427,7 +435,8 @@ class Member extends MobileMember {
         }
     }
 
-    private function draw_txt_to($pos, $string, $line = 2) {
+    private function draw_txt_to($pos, $string, $line = 2)
+    {
         $font_file = PUBLIC_PATH . '/font/hyngt.ttf';
         $_string = '';
         $__string = array();
@@ -454,7 +463,8 @@ class Member extends MobileMember {
         return $__string;
     }
 
-    private function get_lt_rounder_corner($radius) {
+    private function get_lt_rounder_corner($radius)
+    {
         $img = imagecreatetruecolor($radius, $radius); // 创建一个正方形的图像
         $bgcolor = imagecolorallocate($img, 255, 255, 255);  // 图像的背景
         $fgcolor = imagecolorallocate($img, 0, 0, 0);
@@ -475,7 +485,8 @@ class Member extends MobileMember {
         return $img;
     }
 
-    public function auth() {
+    public function auth()
+    {
         $member_model = model('member');
 
         $member_array = array();
@@ -509,7 +520,8 @@ class Member extends MobileMember {
         }
     }
 
-    public function edit_auth() {
+    public function edit_auth()
+    {
         $file_name = input('param.id');
         if (!empty($_FILES[$file_name]['name'])) {
 
@@ -531,7 +543,8 @@ class Member extends MobileMember {
         ds_json_encode(10001, lang('param_error'));
     }
 
-    public function drop_auth() {
+    public function drop_auth()
+    {
         $file_name = input('param.file_name');
         if (!in_array($file_name, array('member_idcard_image1', 'member_idcard_image2', 'member_idcard_image3'))) {
             ds_json_encode(10001, lang('param_error'));
@@ -545,5 +558,4 @@ class Member extends MobileMember {
         }
         ds_json_encode(10000);
     }
-
 }

+ 3 - 3
app/api/controller/MemberArrivalnotice.php

@@ -5,13 +5,13 @@ namespace app\api\controller;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 到货通知控制器
  */
 class MemberArrivalnotice extends MobileMember

+ 3 - 3
app/api/controller/MemberBargain.php

@@ -6,13 +6,13 @@ use think\facade\Db;
 use think\facade\Lang;
 
 /**
- * ============================================================================
+ 
  * 
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 用户砍价控制器
  */
 class MemberBargain extends MobileMember

+ 26 - 19
app/api/controller/MemberInstantMessage.php

@@ -7,23 +7,26 @@ use think\facade\Lang;
 use GatewayClient\Gateway;
 
 /**
- * ============================================================================
+ 
  * DSKMS多用户商城
- * ============================================================================
+ 
  * 
  * ----------------------------------------------------------------------------
  * 
- * ============================================================================
+ 
  * 用户消息控制器
  */
-class MemberInstantMessage extends MobileMember {
+class MemberInstantMessage extends MobileMember
+{
 
-    public function initialize() {
+    public function initialize()
+    {
         parent::initialize();
         Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/live.lang.php');
     }
 
-    public function add() {
+    public function add()
+    {
         if (!config('ds_config.instant_message_register_url')) {
             ds_json_encode(10001, lang('instant_message_register_url_empty'));
         }
@@ -36,11 +39,11 @@ class MemberInstantMessage extends MobileMember {
         $message = input('param.message');
         $message_type = input('param.message_type', 0);
 
-        $res=word_filter($message);
-        if(!$res['code']){
-            ds_json_encode(10001,$res['msg']);
+        $res = word_filter($message);
+        if (!$res['code']) {
+            ds_json_encode(10001, $res['msg']);
         }
-        $message=$res['data']['text'];
+        $message = $res['data']['text'];
         $instant_message_data = array(
             'instant_message_from_id' => $this->member_info['member_id'],
             'instant_message_from_type' => 0,
@@ -72,7 +75,8 @@ class MemberInstantMessage extends MobileMember {
         ds_json_encode(10000, lang('message_send_success'), array('instant_message_data' => $instant_message_data));
     }
 
-    public function join() {
+    public function join()
+    {
         $client_id = input('param.client_id');
         if (!$client_id) {
             ds_json_encode(10001, lang('param_error'));
@@ -113,7 +117,8 @@ class MemberInstantMessage extends MobileMember {
         ds_json_encode(10000, '');
     }
 
-    public function set_message() {
+    public function set_message()
+    {
         $max_id = intval(input('param.max_id'));
         $f_id = intval(input('param.f_id'));
         if (!$max_id || !$f_id) {
@@ -148,7 +153,8 @@ class MemberInstantMessage extends MobileMember {
      * @apiSuccess {Int} result.page_total  总页数
      * @apiSuccess {Boolean} result.hasmore  是否有更多 true是false否
      */
-    public function get_chat_log() {
+    public function get_chat_log()
+    {
         $instant_message_model = model('instant_message');
         $t_id = intval(input('param.t_id'));
 
@@ -164,9 +170,9 @@ class MemberInstantMessage extends MobileMember {
         $condition2[] = array('instant_message_from_id', '=', $t_id);
 
         //最近联系人最多取100个
-        $result = Db::name('instant_message')->where(function ($query) use($condition1, $condition2) {
-                    $query->whereOr([$condition1, $condition2]);
-                })->order('instant_message_add_time desc')->paginate(['list_rows' => 10, 'query' => request()->param()], false);
+        $result = Db::name('instant_message')->where(function ($query) use ($condition1, $condition2) {
+            $query->whereOr([$condition1, $condition2]);
+        })->order('instant_message_add_time desc')->paginate(['list_rows' => 10, 'query' => request()->param()], false);
         $instant_message_list = $result->items();
         foreach ($instant_message_list as $key => $val) {
             $instant_message_list[$key] = $instant_message_model->formatInstantMessage($val);
@@ -196,7 +202,8 @@ class MemberInstantMessage extends MobileMember {
      * @apiSuccess {Int} result.list.u_id  用户ID
      * @apiSuccess {String} result.list.u_name  用户名称
      */
-    public function get_user_list() {
+    public function get_user_list()
+    {
         $condition1 = array();
         $condition1[] = array('instant_message_from_id', '=', $this->member_info['member_id']);
         $condition1[] = array('instant_message_from_type', '=', 0);
@@ -260,7 +267,8 @@ class MemberInstantMessage extends MobileMember {
      * 未读消息查询
      *
      */
-    public function get_msg_count() {
+    public function get_msg_count()
+    {
         $instant_message_model = model('instant_message');
         $condition = array();
         $condition[] = array('instant_message_to_id', '=', $this->member_info['member_id']);
@@ -270,5 +278,4 @@ class MemberInstantMessage extends MobileMember {
         $n = $instant_message_model->getInstantMessageCount($condition);
         ds_json_encode(10000, '', $n);
     }
-
 }

Някои файлове не бяха показани, защото твърде много файлове са промени