From dbc47863efe7c46c4c3914b360beb80be03bedc4 Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Thu, 20 Dec 2018 17:25:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=A7=E5=93=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=86=E7=B1=BB=E6=8A=A5=E9=94=99=EF=BC=8C=E5=92=8C?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F=E7=BE=8E?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/store/StoreCategory.php | 1 - .../admin/model/store/StoreCategory.php | 26 +- .../admin/view/store/store_category/index.php | 265 ++++++++++-------- .../admin/view/store/store_product/index.php | 18 +- extend/service/WechatService.php | 30 +- view/crmebN/pages/orders-con/orders-con.js | 2 +- 6 files changed, 195 insertions(+), 147 deletions(-) diff --git a/application/admin/controller/store/StoreCategory.php b/application/admin/controller/store/StoreCategory.php index 71d72375..782f7eb7 100644 --- a/application/admin/controller/store/StoreCategory.php +++ b/application/admin/controller/store/StoreCategory.php @@ -1,5 +1,4 @@ page((int)$where['page'],(int)$where['limit'])->select()) && count($data) ? $data->toArray() :[]; + foreach ($data as &$item){ + if($item['pid']){ + $item['pid_name'] = self::where('id',$item['pid'])->value('cate_name'); + }else{ + $item['pid_name'] = '顶级'; + } + } + $count=self::systemPage($where,true)->count(); + return compact('count','data'); + } /** * @param $where * @return array */ - public static function systemPage($where){ + public static function systemPage($where,$isAjax=false){ $model = new self; if($where['pid'] != '') $model = $model->where('pid',$where['pid']); else if($where['pid']=='' && $where['cate_name']=='') $model = $model->where('pid',0); if($where['is_show'] != '') $model = $model->where('is_show',$where['is_show']); if($where['cate_name'] != '') $model = $model->where('cate_name','LIKE',"%$where[cate_name]%"); + if($isAjax===true){ + if(isset($where['order']) && $where['order']!=''){ + $model=$model->order(self::setOrder($where['order'])); + } + return $model; + } return self::page($model,function ($item){ if($item['pid']){ $item['pid_name'] = self::where('id',$item['pid'])->value('cate_name'); diff --git a/application/admin/view/store/store_category/index.php b/application/admin/view/store/store_category/index.php index eb58749b..f6d948f9 100644 --- a/application/admin/view/store/store_category/index.php +++ b/application/admin/view/store/store_category/index.php @@ -1,133 +1,172 @@ {extend name="public/container"} {block name="content"} -
-
-
-
- 分类首页 - -
+
+
+
+
+
搜索条件
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
-
-
-
-
- - -
- - -
-
+
+ +
+
+
分类列表
+
+ - +
+ 分类首页 + +
+
+ + + +
-
- - - - - - - - - - - - - - - {volist name="list" id="vo"} - - - - - - - - - - - {/volist} - -
编号父级分类名称分类图标排序是否显示操作
- {$vo.id} - - {$vo.pid_name} - - {$vo.cate_name} - - {$vo.cate_name} - - {$vo.sort} - - - -
-
- - -
-
-
-
- {include file="public/inner_page"}
+ {/block} {block name="script"} {/block} diff --git a/application/admin/view/store/store_product/index.php b/application/admin/view/store/store_product/index.php index f86bc0a3..c5877ccd 100644 --- a/application/admin/view/store/store_product/index.php +++ b/application/admin/view/store/store_product/index.php @@ -71,7 +71,7 @@
{switch name='type'} {case value="1"} - + {/case} {case value="2"} @@ -175,15 +175,15 @@ case 2: join=[ {type:'checkbox'}, - {field: 'id', title: 'ID', sort: true,event:'id',width:'5%'}, - {field: 'image', title: '产品图片',templet:'#image'}, + {field: 'id', title: 'ID', sort: true,event:'id',width:'6%'}, + {field: 'image', title: '产品图片',templet:'#image',width:'10%'}, {field: 'store_name', title: '产品名称',templet:'#store_name'}, - {field: 'price', title: '产品价格',edit:'price'}, - {field: 'ficti', title: '虚拟销量',edit:'ficti'}, - {field: 'stock', title: '库存',edit:'stock'}, - {field: 'sort', title: '排序',edit:'sort'}, - {field: 'sales', title: '销量',sort: true,event:'sales'}, - {field: 'status', title: '状态',templet:"#checkboxstatus"}, + {field: 'price', title: '价格',edit:'price',width:'8%'}, + {field: 'ficti', title: '虚拟销量',edit:'ficti',width:'8%'}, + {field: 'stock', title: '库存',edit:'stock',width:'6%'}, + {field: 'sort', title: '排序',edit:'sort',width:'6%'}, + {field: 'sales', title: '销量',sort: true,event:'sales',width:'6%'}, + {field: 'status', title: '状态',templet:"#checkboxstatus",width:'8%'}, {field: 'right', title: '操作',align:'center',toolbar:'#act',width:'14%'}, ]; break; diff --git a/extend/service/WechatService.php b/extend/service/WechatService.php index a18875db..347c069f 100644 --- a/extend/service/WechatService.php +++ b/extend/service/WechatService.php @@ -27,25 +27,24 @@ class WechatService { private static $instance = null; - /**获取微信配置参数 - * @return array - */ public static function options() { - $wechat = SystemConfigService::more(['wechat_appid','wechat_appsecret','wechat_token']); + $wechat = SystemConfigService::more(['wechat_appid','wechat_appsecret','wechat_token','wechat_encodingaeskey','wechat_encode']); $payment = SystemConfigService::more(['pay_weixin_mchid','pay_weixin_client_cert','pay_weixin_client_key','pay_weixin_key','pay_weixin_open']); $config = [ - 'app_id'=>isset($wechat['wechat_appid']) ? trim($wechat['wechat_appid']):'', - 'secret'=>isset($wechat['wechat_appsecret']) ? trim($wechat['wechat_appsecret']):'', - 'token'=>isset($wechat['wechat_token']) ? trim($wechat['wechat_token']):'', + 'app_id'=>isset($wechat['wechat_appid']) ? $wechat['wechat_appid']:'', + 'secret'=>isset($wechat['wechat_appsecret']) ? $wechat['wechat_appsecret']:'', + 'token'=>isset($wechat['wechat_token']) ? $wechat['wechat_token']:'', 'guzzle' => [ 'timeout' => 10.0, // 超时时间(秒) ], ]; + if((int)$wechat['wechat_encode']>0 && isset($wechat['wechat_encodingaeskey']) && !empty($wechat['wechat_encodingaeskey'])) + $config['aes_key'] = $wechat['wechat_encodingaeskey']; if(isset($payment['pay_weixin_open']) && $payment['pay_weixin_open'] == 1){ $config['payment'] = [ - 'merchant_id'=>trim($payment['pay_weixin_mchid']), - 'key'=>trim($payment['pay_weixin_key']), + 'merchant_id'=>$payment['pay_weixin_mchid'], + 'key'=>$payment['pay_weixin_key'], 'cert_path'=>realpath('.'.$payment['pay_weixin_client_cert']), 'key_path'=>realpath('.'.$payment['pay_weixin_client_key']), 'notify_url'=>SystemConfigService::get('site_url').Url::build('wap/Wechat/notify') @@ -62,9 +61,6 @@ class WechatService return self::$instance; } - /** - * 微信接口 - */ public static function serve() { $wechat = self::application(true); @@ -133,6 +129,7 @@ class WechatService $response = HookService::resultListen('wechat_message_other',$message,null,true,$behavior); break; } + return $response; }); } @@ -370,11 +367,6 @@ class WechatService return self::paymentService()->refund($orderNo,$refundNo,$totalFee,$refundFee,$opUserId,$type,$refundAccount,$refundReason); } - /**订单退款 - * @param $orderNo - * @param array $opt - * @return bool - */ public static function payOrderRefund($orderNo, array $opt) { if(!isset($opt['pay_price'])) exception('缺少pay_price'); @@ -420,10 +412,6 @@ class WechatService return self::application()->js; } - /** jsSdk - * @param string $url - * @return array|string - */ public static function jsSdk($url = '') { $apiList = ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'playVoice', 'pauseVoice', 'stopVoice', 'onVoicePlayEnd', 'uploadVoice', 'downloadVoice', 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'translateVoice', 'getNetworkType', 'openLocation', 'getLocation', 'hideOptionMenu', 'showOptionMenu', 'hideMenuItems', 'showMenuItems', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem', 'closeWindow', 'scanQRCode', 'chooseWXPay', 'openProductSpecificView', 'addCard', 'chooseCard', 'openCard']; diff --git a/view/crmebN/pages/orders-con/orders-con.js b/view/crmebN/pages/orders-con/orders-con.js index 6f5b7919..b9bb340e 100644 --- a/view/crmebN/pages/orders-con/orders-con.js +++ b/view/crmebN/pages/orders-con/orders-con.js @@ -66,7 +66,7 @@ Page({ }) setTimeout(function () { wx.navigateTo({ //跳转至指定页面并关闭其他打开的所有页面(这个最好用在返回至首页的的时候) - url: '/pages/orders-con/orders-con?order_id=' + data.result.orderId + url: '/pages/orders-con/orders-con?order_id=' + data.result.order_id }) }, 1200) },