From 4589382585b51c7de0bc34f3cacf9b57518f17b6 Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Sat, 24 Nov 2018 09:59:15 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=B2=A1=E6=9C=89=E6=8E=A8=E5=B9=BF=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wap/view/first/my/index.html | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/application/wap/view/first/my/index.html b/application/wap/view/first/my/index.html index 85fdf3bdd..6ba104973 100644 --- a/application/wap/view/first/my/index.html +++ b/application/wap/view/first/my/index.html @@ -78,13 +78,7 @@ {/volist} - {eq name="userInfo.is_promoter" value="1"} - - - -

我的余额

-
- */ ?> + {if condition="$statu == 2 || $userInfo['is_promoter'] == 1"}
@@ -97,7 +91,7 @@

推广二维码

- {/eq} + {/if} {include file="public/store_menu"} -- Gitee From 4fe22856c2c8b57a217ab3e719295b03074dea2b Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Sat, 24 Nov 2018 11:26:55 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=E5=85=B3?= =?UTF-8?q?=E6=B3=A8=E5=9B=9E=E5=A4=8D=E9=BB=98=E8=AE=A4=E6=8A=A5=E9=94=99?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=97=B6=E9=97=B4=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=A1=86=E5=A4=AA=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/ump/StoreCombination.php | 2 +- application/admin/controller/wechat/Reply.php | 19 +-- .../admin/model/wechat/WechatReply.php | 10 ++ .../admin/view/public/form-builder.php | 3 + .../ump/store_combination/combina_list.php | 3 +- .../routine/model/store/StoreOrder.php | 5 +- .../behavior/routine/StoreProductBehavior.php | 159 ++++++++++++++++++ extend/traits/CurdControllerTrait.php | 4 + .../form-builder/src/view/formScript.php | 1 + 9 files changed, 190 insertions(+), 16 deletions(-) diff --git a/application/admin/controller/ump/StoreCombination.php b/application/admin/controller/ump/StoreCombination.php index b35db39d9..b88f6df31 100644 --- a/application/admin/controller/ump/StoreCombination.php +++ b/application/admin/controller/ump/StoreCombination.php @@ -15,7 +15,7 @@ use app\admin\model\ump\StoreCombinationAttrResult; use app\admin\model\ump\StoreCombination as StoreCombinationModel; use think\Url; use app\admin\model\system\SystemAttachment; -use app\wap\model\store\StorePink; +use app\admin\model\ump\StorePink; /** * 拼团管理 diff --git a/application/admin/controller/wechat/Reply.php b/application/admin/controller/wechat/Reply.php index e5151fdc5..888e02525 100644 --- a/application/admin/controller/wechat/Reply.php +++ b/application/admin/controller/wechat/Reply.php @@ -16,14 +16,15 @@ use think\Request; */ class Reply extends AuthController { + /**关注回复 + * @return mixed|void + */ public function index() { if(empty(input('key'))) return $this->failed('请输入参数key'); if(empty(input('title'))) return $this->failed('请输入参数title'); - $replay = WechatReply::where('key',input('key'))->find(); - $replay_arr =!empty($replay) ? $replay->toArray() : []; - $replay_arr['data'] = json_decode(isset($replay_arr['data']) ? $replay_arr['data'] : '',true); - $this->assign('replay_arr',json_encode($replay_arr)); + $replay = WechatReply::getDataByKey(input('key')); + $this->assign('replay_arr',json_encode($replay)); $this->assign('key',input('key')); $this->assign('title',input('title')); return $this->fetch(); @@ -36,10 +37,8 @@ class Reply extends AuthController ],$this->request); // dump($where); // exit(); - if(!empty($where['key'])) $replay = WechatReply::where('key',$where['key'])->find(); - $replay_arr = $replay->toArray(); + if(!empty($where['key'])) $replay_arr = WechatReply::getDataByKey($where['key']); $replay_arr['code'] = 200; - $replay_arr['data'] = json_decode($replay_arr['data'],true); if(empty($replay_arr)) { $replay_arr['code'] = 0; } @@ -117,10 +116,8 @@ class Reply extends AuthController public function info_keyword(){ $key = input('key'); if(empty($key)) return $this->failed('参数错误,请重新修改'); - $replay = WechatReply::where('key',$key)->find(); - $replay_arr = $replay->toArray(); - $replay_arr['data'] = json_decode($replay_arr['data'],true); - $this->assign('replay_arr',json_encode($replay_arr)); + $replay = WechatReply::getDataByKey($key); + $this->assign('replay_arr',json_encode($replay)); $this->assign('key',$key); $this->assign('dis',2); return $this->fetch('add_keyword'); diff --git a/application/admin/model/wechat/WechatReply.php b/application/admin/model/wechat/WechatReply.php index 66ce3cf96..4a82d2c76 100644 --- a/application/admin/model/wechat/WechatReply.php +++ b/application/admin/model/wechat/WechatReply.php @@ -26,6 +26,15 @@ class WechatReply extends ModelBasic public static $reply_type = ['text','image','news','voice']; + /**根据关键字查询一条 + * @param $key + */ + public static function getDataByKey($key){ + $resdata = []; + $resdata = self::where('key',$key)->find(); + $resdata['data'] = json_decode($resdata['data'],true); + return $resdata; + } public function getUrlAttr($value,$data) { return $value == '' ? \think\Url::build('index/index/news',['id'=>$data['id']]) : $value; @@ -194,4 +203,5 @@ class WechatReply extends ModelBasic } + } \ No newline at end of file diff --git a/application/admin/view/public/form-builder.php b/application/admin/view/public/form-builder.php index 16f3c077c..9e3f10fac 100644 --- a/application/admin/view/public/form-builder.php +++ b/application/admin/view/public/form-builder.php @@ -8,6 +8,7 @@ /*弹框样式修改*/ .ivu-modal-body{padding: 5;} .ivu-modal-confirm-footer{display: none;} + .ivu-date-picker {display: inline-block;line-height: normal;width: 280px;} @@ -19,6 +20,8 @@ //关闭当前窗口 // var index = parent.layer.getFrameIndex(window.name); // parent.layer.close(index); + //提交成功后按钮恢复 + $r.btn.finish(); }; (function () { var create = formScript()?> diff --git a/application/admin/view/ump/store_combination/combina_list.php b/application/admin/view/ump/store_combination/combina_list.php index c9aec669d..ac66dc185 100644 --- a/application/admin/view/ump/store_combination/combina_list.php +++ b/application/admin/view/ump/store_combination/combina_list.php @@ -51,13 +51,14 @@ 结束时间 状态 操作 + {volist name="list" id="vo"} - {$vo.nickName}/{$vo.uid} + {$vo.nickname}/{$vo.uid} {$vo.add_time|date='Y-m-d H:i:s',###} diff --git a/application/routine/model/store/StoreOrder.php b/application/routine/model/store/StoreOrder.php index 1378593c7..34442e2ee 100644 --- a/application/routine/model/store/StoreOrder.php +++ b/application/routine/model/store/StoreOrder.php @@ -20,8 +20,7 @@ use app\routine\model\user\UserAddress; use app\routine\model\user\UserBill; use app\routine\model\user\WechatUser; use basic\ModelBasic; -use behavior\wap\StoreProductBehavior; -use behavior\routine\StoreProductBehavior as StoreProductBehaviorRoutine; +use behavior\routine\StoreProductBehavior; use behavior\wechat\PaymentBehavior; use service\HookService; use service\RoutineService; @@ -521,7 +520,7 @@ class StoreOrder extends ModelBasic if(false !== self::edit(['status'=>2],$order['id'],'id') && false !== StoreOrderStatus::status($order['id'],'user_take_delivery','用户已收货')){ try{ - HookService::listen('store_product_order_user_take_delivery',$order,$uid,false,StoreProductBehaviorRoutine::class); + HookService::listen('store_product_order_user_take_delivery',$order,$uid,false,StoreProductBehavior::class); }catch (\Exception $e){ return self::setErrorInfo($e->getMessage()); } diff --git a/extend/behavior/routine/StoreProductBehavior.php b/extend/behavior/routine/StoreProductBehavior.php index 1988fe5bb..e97f25385 100644 --- a/extend/behavior/routine/StoreProductBehavior.php +++ b/extend/behavior/routine/StoreProductBehavior.php @@ -11,7 +11,10 @@ namespace behavior\routine; use app\routine\model\store\StoreOrder; use app\routine\model\user\User; use app\routine\model\user\WechatUser; +use app\routine\model\user\UserAddress; +use app\admin\model\order\StoreOrder as StoreOrderAdminModel; use service\SystemConfigService; +use service\WechatTemplateService; class StoreProductBehavior { @@ -29,4 +32,160 @@ class StoreProductBehavior if($order['total_price'] >= $giveCouponMinPrice) WechatUser::userTakeOrderGiveCoupon($uid); if(!($res1 && $res2)) exception('收货失败!'); } + /** + * 订单创建成功后 + * @param $oid + */ + public static function storeProductOrderCreate($order,$group) + { + UserAddress::be(['is_default'=>1,'uid'=>$order['uid']]) || UserAddress::setDefaultAddress($group['addressId'],$order['uid']); + } + + /** + * 修改发货状态 为送货 + * @param $data + * $data array 送货方式 送货人姓名 送货人电话 + * @param $oid + * $oid string store_order表中的id + */ + public static function storeProductOrderDeliveryAfter($data,$oid){ + StoreOrder::orderPostageAfter($data,$oid); + } + + /** + * 修改发货状态 为发货 + * @param $data + * $data array 发货方式 送货人姓名 送货人电话 + * @param $oid + * $oid string store_order表中的id + */ + public static function storeProductOrderDeliveryGoodsAfter($data,$oid){ + StoreOrder::orderPostageAfter($data,$oid); + } + + /** + * 修改状态 为已收货 + * @param $data + * $data array status 状态为 已收货 + * @param $oid + * $oid string store_order表中的id + */ + public static function storeProductOrderTakeDeliveryAfter($order,$oid) + { + $res1 = StoreOrder::gainUserIntegral($order); + $res2 = User::backOrderBrokerage($order); + StoreOrder::orderTakeAfter($order); + if(!($res1 && $res2)) exception('收货失败!'); + } + + /** + * 线下付款 + * @param $id + * $id 订单id + */ + public static function storeProductOrderOffline($id){ + + } + + /** + * 修改状态为 已退款 + * @param $data + * $data array type 1 直接退款 2 退款后返回原状态 refund_price 退款金额 + * @param $oid + * $oid string store_order表中的id + */ + public static function storeProductOrderRefundYAfter($data,$oid){ + StoreOrderAdminModel::refundTemplate($data,$oid); + } + + /** + * 修改状态为 不退款 + * @param $data + * $data string 退款原因 + * @param $oid + * $oid string store_order表中的id + */ + public static function storeProductOrderRefundNAfter($data,$oid){ + + } + + + /** + * 修改订单状态 + * @param $data + * data total_price 商品总价 pay_price 实际支付 + * @param $oid + * oid 订单id + */ + public static function storeProductOrderEditAfter($data,$oid){ + + } + /** + * 修改送货信息 + * @param $data + * $data array 送货人姓名/快递公司 送货人电话/快递单号 + * @param $oid + * $oid string store_order表中的id + */ + public static function storeProductOrderDistributionAfter($data,$oid){ + + } + + /** + * 用户申请退款 + * @param $oid + * @param $uid + */ + public static function storeProductOrderApplyRefundAfter($oid, $uid) + { + $order = StoreOrder::where('id',$oid)->find(); + WechatTemplateService::sendAdminNoticeTemplate([ + 'first'=>"亲,您有一个订单申请退款 \n订单号:{$order['order_id']}", + 'keyword1'=>'申请退款', + 'keyword2'=>'待处理', + 'keyword3'=>date('Y/m/d H:i',time()), + 'remark'=>'请及时处理' + ]); + } + + + /** + * 评价产品 + * @param $replyInfo + * @param $cartInfo + */ + public static function storeProductOrderReply($replyInfo, $cartInfo) + { + StoreOrder::checkOrderOver($cartInfo['oid']); + } + + /** + * 订单全部产品评价完 + * @param $oid + */ + public static function storeProductOrderOver($oid) + { + + } + + /** + * 退积分 + * @param $product + * $product 商品信息 + * @param $back_integral + * $back_integral 退多少积分 + */ + public static function storeOrderIntegralBack($product,$back_integral){ + + } + + /** + * 加入购物车成功之后 + * @param array $cartInfo 购物车信息 + * @param array $userInfo 用户信息 + */ + public static function storeProductSetCartAfterAfter($cartInfo, $userInfo) + { + + } } \ No newline at end of file diff --git a/extend/traits/CurdControllerTrait.php b/extend/traits/CurdControllerTrait.php index e5c384e3d..56e628895 100644 --- a/extend/traits/CurdControllerTrait.php +++ b/extend/traits/CurdControllerTrait.php @@ -11,6 +11,10 @@ use think\Request; trait CurdControllerTrait { + /**保存数据库 + * @param $id + * @param $field + */ public function change_field($id,$field) { if(!isset($this->bindModel)) return exception('方法不存在!'); diff --git a/vendor/xaboy/form-builder/src/view/formScript.php b/vendor/xaboy/form-builder/src/view/formScript.php index b7e7de55d..716e47942 100644 --- a/vendor/xaboy/form-builder/src/view/formScript.php +++ b/vendor/xaboy/form-builder/src/view/formScript.php @@ -48,6 +48,7 @@ success: function (res) { if (res.code == 200) { vm.$Message.success(res.msg); + $f.submitStatus({loading: false}); formCreate.formSuccess && formCreate.formSuccess(res, $f, formData); callback && callback(0, res, $f, formData); //TODO 表单提交成功! -- Gitee From 0f4de270516bf9f892d35a22847a2b5fcdcefa1d Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Sat, 24 Nov 2018 11:34:43 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/article/Article.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/application/admin/controller/article/Article.php b/application/admin/controller/article/Article.php index 3c184ee36..f1b9436ed 100644 --- a/application/admin/controller/article/Article.php +++ b/application/admin/controller/article/Article.php @@ -34,13 +34,19 @@ class Article extends AuthController $where['merchant'] = 0;//区分是管理员添加的图文显示 0 还是 商户添加的图文显示 1 $catlist = ArticleCategoryModel::where('is_del',0)->select()->toArray(); //获取分类列表 - $tree = Phptree::makeTreeForHtml($catlist); - $this->assign(compact('tree')); - if($pid){ - $pids = Util::getChildrenPid($tree,$pid); - $where['cid'] = ltrim($pid.$pids); + if($catlist){ + $tree = Phptree::makeTreeForHtml($catlist); + $this->assign(compact('tree')); + if($pid){ + $pids = Util::getChildrenPid($tree,$pid); + $where['cid'] = ltrim($pid.$pids); + } + }else{ + $tree = []; + $this->assign(compact('tree')); } + $this->assign('cate',ArticleCategoryModel::getTierList()); $this->assign(ArticleModel::getAll($where)); return $this->fetch(); -- Gitee From 2aea69784d52ae507bb782f8b9d94c84566d1a29 Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Sat, 24 Nov 2018 11:42:48 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/model/order/StoreOrder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/model/order/StoreOrder.php b/application/admin/model/order/StoreOrder.php index d30c8f22e..1e82e39bf 100644 --- a/application/admin/model/order/StoreOrder.php +++ b/application/admin/model/order/StoreOrder.php @@ -89,7 +89,7 @@ class StoreOrder extends ModelBasic $item['pay_type_name']='微信支付'; break; case 'yue': - $item['pay_type_name']='微信支付'; + $item['pay_type_name']='余额支付'; break; case 'offline': $item['pay_type_name']='线下支付'; -- Gitee From 14e1d696e7696a4e6f35d8de815493dc4fe04442 Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Mon, 26 Nov 2018 12:01:57 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=A7=92=E6=9D=80?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=80=92=E8=AE=A1=E6=97=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/model/order/StoreOrder.php | 4 ++- .../admin/view/ump/store_seckill/index.php | 32 ++++++++++++------- application/wap/view/first/index/index.html | 4 ++- .../wap/view/first/store/seckill_index.html | 2 ++ public/wap/first/crmeb/css/style.css | 4 +-- 5 files changed, 30 insertions(+), 16 deletions(-) diff --git a/application/admin/model/order/StoreOrder.php b/application/admin/model/order/StoreOrder.php index 1e82e39bf..6f89e13ed 100644 --- a/application/admin/model/order/StoreOrder.php +++ b/application/admin/model/order/StoreOrder.php @@ -116,9 +116,11 @@ class StoreOrder extends ModelBasic }else if($item['paid']==1 && $item['status']==1 && $item['refund_status']==0){ $item['status_name']='待收货'; }else if($item['paid']==1 && $item['status']==2 && $item['refund_status']==0){ - $item['status_name']='待评价'; + $item['status_name']='已收货'; }else if($item['paid']==1 && $item['status']==3 && $item['refund_status']==0){ $item['status_name']='待评价'; + }else if($item['paid']==1 && $item['status']==4 && $item['refund_status']==0){ + $item['status_name']='已完成'; }else if($item['paid']==1 && $item['refund_status']==1){ $item['status_name']=<<申请退款
diff --git a/application/admin/view/ump/store_seckill/index.php b/application/admin/view/ump/store_seckill/index.php index 3a6a01ccc..fc39be2a1 100644 --- a/application/admin/view/ump/store_seckill/index.php +++ b/application/admin/view/ump/store_seckill/index.php @@ -89,6 +89,26 @@ {block name="script"} + + + + - {include file="public/inner_page"} + {/block} {block name="script"}