Просмотр исходного кода

!9 更新bug
Merge pull request !9 from 聆听/develop

聆听 7 лет назад
Родитель
Сommit
80015a9185
29 измененных файлов с 407 добавлено и 160 удалено
  1. 11 5
      application/admin/controller/article/Article.php
  2. 1 1
      application/admin/controller/setting/SystemConfig.php
  3. 2 2
      application/admin/controller/setting/SystemGroupData.php
  4. 1 1
      application/admin/controller/ump/StoreCombination.php
  5. 4 1
      application/admin/controller/ump/StoreSeckill.php
  6. 8 11
      application/admin/controller/wechat/Reply.php
  7. 2 2
      application/admin/model/order/StoreOrder.php
  8. 1 1
      application/admin/model/system/SystemConfig.php
  9. 1 1
      application/admin/model/system/SystemConfigTab.php
  10. 10 0
      application/admin/model/wechat/WechatReply.php
  11. 3 0
      application/admin/view/public/form-builder.php
  12. 2 1
      application/admin/view/ump/store_combination/combina_list.php
  13. 20 12
      application/admin/view/ump/store_seckill/index.php
  14. 122 86
      application/admin/view/user/user_notice/index.php
  15. 2 3
      application/routine/model/store/StoreOrder.php
  16. 6 1
      application/routine/model/user/RoutineUser.php
  17. 1 1
      application/version.php
  18. 3 1
      application/wap/view/first/index/index.html
  19. 2 8
      application/wap/view/first/my/index.html
  20. 2 0
      application/wap/view/first/store/seckill_index.html
  21. 159 0
      extend/behavior/routine/StoreProductBehavior.php
  22. 10 1
      extend/behavior/wechat/UserBehavior.php
  23. 3 3
      extend/service/WechatTemplateService.php
  24. 4 0
      extend/traits/CurdControllerTrait.php
  25. 6 13
      public/install/crmeb.sql
  26. 1 1
      public/install/templates/step5.php
  27. 2 2
      public/wap/first/crmeb/css/style.css
  28. 17 2
      update.sql
  29. 1 0
      vendor/xaboy/form-builder/src/view/formScript.php

+ 11 - 5
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();

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
application/admin/controller/setting/SystemConfig.php


+ 2 - 2
application/admin/controller/setting/SystemGroupData.php

@@ -52,7 +52,7 @@ class SystemGroupData extends AuthController
                 $params = explode("\n",$value["param"]);
                 if(is_array($params) && !empty($params)){
                     foreach ($params as $index => $v) {
-                        $vl = explode('=',$v);
+                        $vl = explode('=>',$v);
                         if(!empty($vl[0]) && !empty($vl[1])){
                             $info[$index]["value"] = $vl[0];
                             $info[$index]["label"] = $vl[1];
@@ -154,7 +154,7 @@ class SystemGroupData extends AuthController
                 $params = explode("\n",$value["param"]);
                 if(is_array($params) && !empty($params)){
                     foreach ($params as $index => $v) {
-                        $vl = explode('=',$v);
+                        $vl = explode('=>',$v);
                         if(!empty($vl[0]) && !empty($vl[1])){
                             $info[$index]["value"] = $vl[0];
                             $info[$index]["label"] = $vl[1];

+ 1 - 1
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;
 
 /**
  * 拼团管理

+ 4 - 1
application/admin/controller/ump/StoreSeckill.php

@@ -65,6 +65,9 @@ class StoreSeckill extends AuthController
         return Json::successlayui(['count'=>$seckillList['list']['total'],'data'=>$data]);
     }
 
+    public function get_seckill_id(){
+        return Json::successlayui(StoreSeckillModel::getSeckillIdAll());
+    }
     /**
      * 添加秒杀产品
      * @return form-builder
@@ -221,7 +224,7 @@ class StoreSeckill extends AuthController
         $f[] = Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')),$product->getData('image'))->icon('image');
         $f[] = Form::frameImages('images','产品轮播图(640*640px)',Url::build('admin/widget.images/index',array('fodder'=>'images')),json_decode($product->getData('images')))->maxLength(5)->icon('images');
         $f[] = Form::number('price','秒杀价',$product->getData('price'))->min(0)->col(12);
-        $f[] = Form::number('ot_price','原价',$product->getData('price'))->min(0)->col(12);
+        $f[] = Form::number('ot_price','原价',$product->getData('ot_price'))->min(0)->col(12);
         $f[] = Form::number('cost','成本价',$product->getData('cost'))->min(0)->col(12);
         $f[] = Form::number('stock','库存',$product->getData('stock'))->min(0)->precision(0)->col(12);
         $f[] = Form::number('sales','销量',$product->getData('sales'))->min(0)->precision(0)->col(12);

+ 8 - 11
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');

+ 2 - 2
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']='线下支付';
@@ -118,7 +118,7 @@ class StoreOrder extends ModelBasic
             }else if($item['paid']==1 && $item['status']==2 && $item['refund_status']==0){
                 $item['status_name']='待评价';
             }else if($item['paid']==1 && $item['status']==3 && $item['refund_status']==0){
-                $item['status_name']='待评价';
+                $item['status_name']='已完成';
             }else if($item['paid']==1 && $item['refund_status']==1){
                 $item['status_name']=<<<HTML
 <b style="color:#f124c7">申请退款</b><br/>

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
application/admin/model/system/SystemConfig.php


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
application/admin/model/system/SystemConfigTab.php


+ 10 - 0
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
     }
 
 
+
 }

+ 3 - 0
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;}
     </style>
 </head>
 <body>
@@ -19,6 +20,8 @@
         //关闭当前窗口
 //        var index = parent.layer.getFrameIndex(window.name);
 //        parent.layer.close(index);
+        //提交成功后按钮恢复
+        $r.btn.finish();
     };
 	(function () {
 		var create = <?=$form->formScript()?>

+ 2 - 1
application/admin/view/ump/store_combination/combina_list.php

@@ -51,13 +51,14 @@
                             <th class="text-center">结束时间</th>
                             <th class="text-center">状态</th>
                             <th class="text-center">操作</th>
+
                         </tr>
                         </thead>
                         <tbody class="">
                         {volist name="list" id="vo"}
                         <tr>
                             <td class="text-center">
-                                {$vo.nickName}/{$vo.uid}
+                                {$vo.nickname}/{$vo.uid}
                             </td>
                             <td class="text-center">
                                 {$vo.add_time|date='Y-m-d H:i:s',###}

+ 20 - 12
application/admin/view/ump/store_seckill/index.php

@@ -89,6 +89,26 @@
 {block name="script"}
 <script src="{__ADMIN_PATH}js/layuiList.js"></script>
 <script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
+<script>
+    setTime();
+    function setTime() {
+        setTimeout(function () {
+            $eb.axios.get("{:Url('get_seckill_id')}").then(function(res){
+                $.each(res.data.count,function (index,item) {
+                    var time = $('.count-time-'+item).attr('data-time');
+                    if(time != ''){
+                        $('.count-time-'+item).downCount({
+                            date: time,
+                            offset: +8
+                        });
+                    }
+                })
+            }).catch(function(err){
+                console.log(err);
+            });
+        },2000);
+    }
+</script>
 <script>
     layList.form.render();
     layList.tableList('seckillList',"{:Url('get_seckill_list')}",function () {
@@ -106,18 +126,6 @@
             {field: 'right', title: '操作', width: '5%', align: 'center', toolbar: '#barDemo',unresize:true}
         ]
     });
-    setTime();
-    window.$seckillId = <?php echo json_encode($seckillId);?>;
-    function setTime() {
-        setTimeout(function () {
-            $.each($seckillId,function (index,item) {
-                $('.count-time-'+item).downCount({
-                    date: $('.count-time-'+item).attr('data-time'),
-                    offset: +8
-                });
-            })
-        },3000);
-    }
     layList.tool(function (event,data,obj) {
         switch (event) {
             case 'delstor':

+ 122 - 86
application/admin/view/user/user_notice/index.php

@@ -1,101 +1,137 @@
 {extend name="public/container"}
 {block name="content"}
-<div class="row">
-    <div class="col-sm-12">
-        <div class="ibox">
-            <div class="ibox-title">
-                <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加通知</button>
-            </div>
-            <div class="ibox-content">
-                <div class="table-responsive">
-                    <table class="table table-striped  table-bordered">
-                        <thead>
-                        <tr>
-                            <th class="text-center">编号</th>
-                            <th class="text-center">发送人</th>
-                            <th class="text-center">通知标题</th>
-                            <th class="text-center" width="700">通知内容</th>
-                            <th class="text-center">消息类型</th>
-                            <th class="text-center">是否发送</th>
-                            <th class="text-center">操作</th>
-                        </tr>
-                        </thead>
-                        <tbody class="">
-                        {volist name="list" id="vo"}
-                        <tr>
-                            <td class="text-center">{$vo.id}</td>
-                            <td class="text-center">{$vo.user}</td>
-                            <td class="text-center">{$vo.title}</td>
-                            <td class="text-center">{$vo.content}</td>
-                            <td class="text-center">
-                                {if condition="$vo['type'] eq 1"}
-                                    系统消息
-                                {elseif condition="$vo['type'] eq 2" /}
-                                    用户通知
-                                {/if}
-                            </td>
-                            <td class="text-center">
-                                {if condition="$vo['is_send'] eq 1"}
-                                    状态:<span style="color:green;">已发送</span><br />
-                                    时间:{$vo.send_time|date='Y-m-d H:i:s',###}
-                                {else /}
-                                    状态:<span style="color:red;">未发送</span> <a class="btn-send" data-url="{:Url('send',array('id'=>$vo['id']))}">立即发送</a>
-                                {/if}
-                            </td>
-                            <td class="text-center">
-                                <button class="btn btn-info btn-xs" type="button"  onclick="window.location.href='{:Url('user',array('id'=>$vo['id']))}'"><i class="fa fa-user"></i> 用户信息</button>
-                                {if condition="$vo['is_send'] eq 0"}
-                                    <button class="btn btn-info btn-xs" type="button"  onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-paste"></i> 编辑</button>
-                                {/if}
-                                <button class="btn btn-warning btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-warning"></i> 删除</button>
-                            </td>
-                        </tr>
-                        {/volist}
-                        </tbody>
-                    </table>
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15"  id="app">
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">通知列表</div>
+                <div class="layui-card-body">
+                    <div class="layui-btn-container">
+                        <button class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加通知</button>
+                    </div>
+                    <table class="layui-hide" id="List" lay-filter="List"></table>
+                    <!--消息状态-->
+                    <script type="text/html" id="type">
+                        {{# if(d.type==1){ }}
+                            <p>系统消息</p>
+                        {{# }else if(d.type==2){ }}
+                            <p>用户通知</p>
+                        {{# } }}
+                    </script>
+                    <!--消息状态-->
+                    <script type="text/html" id="is_send">
+                        {{# if(d.is_send==1){ }}
+                        状态:<span style="color:green;">已发送</span><br />
+                        时间:{{d.send_time}}
+                        {{# }else{ }}
+                        状态:<span style="color:red;">未发送</span> <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event='send'>立即发送</a>
+                        {{# } }}
+                    </script>
+                    <script type="text/html" id="act">
+                        <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span class="caret"></span></button>
+                        <ul class="layui-nav-child layui-anim layui-anim-upbit">
+                            <li>
+                                <a href="javascript:;"  onclick="window.location.href='{:Url('user')}?id={{d.id}}'"><i class="fa fa-user"></i> 用户信息</a>
+                            </li>
+                            {{# if(d.is_send==0){ }}
+                            <li>
+                                <a href="javascript:;"  onclick="$eb.createModalFrame('编辑','{:Url('edit')}?id={{d.id}}')"><i class="fa fa-paste"></i> 编辑</a>
+                            </li>
+                            {{# } }}
+                            <li>
+                                <a href="javascript:;" lay-event='warning'><i class="fa fa-warning"></i> 删除</a>
+                            </li>
+                        </ul>
+                    </script>
                 </div>
-                {include file="public/inner_page"}
             </div>
         </div>
     </div>
 </div>
+<script src="{__ADMIN_PATH}js/layuiList.js"></script>
 {/block}
 {block name="script"}
 <script>
-    $('.btn-warning').on('click',function(){
-        window.t = $(this);
-        var _this = $(this),url =_this.data('url');
-        $eb.$swal('delete',function(){
-            $eb.axios.get(url).then(function(res){
-                if(res.status == 200 && res.data.code == 200) {
-                    $eb.$swal('success',res.data.msg);
-                    _this.parents('tr').remove();
-                }else
-                    return Promise.reject(res.data.msg || '删除失败')
-            }).catch(function(err){
-                $eb.$swal('error',err);
-            });
-        })
+    layList.tableList('List',"{:Url('index')}",function (){
+        return [
+            {field: 'id', title: '编号', sort: true,event:'id'},
+            {field: 'user', title: '发送人'},
+            {field: 'title', title: '通知标题'},
+            {field: 'content', title: '通知内容'},
+            {field: 'type', title: '消息类型',templet:'#type'},
+            {field: 'is_send', title: '是否发送',templet:'#is_send'},
+            {field: 'right', title: '操作',align:'center',toolbar:'#act',width:'10%'},
+        ];
     });
-    $('.btn-send').on('click',function(){
-        var _this = $(this),url =_this.data('url');
-        $eb.$swal('delete',function(){
-            $eb.axios.get(url).then(function(res){
-                if(res.status == 200 && res.data.code == 200) {
-                    $eb.$swal('success',res.data.msg);
-                    window.location.reload();
-                }else
-                    return Promise.reject(res.data.msg || '发送失败')
-            }).catch(function(err){
-                $eb.$swal('error',err);
-            });
-        },{
-            title:"您确定要发送这条信息吗",
-            text:"发送后将无法修改通知信息,请谨慎操作!",
-            confirm:"是的,我要发送!",
-            cancel:"让我再考虑一下"
+    //下拉框
+    $(document).click(function (e) {
+        $('.layui-nav-child').hide();
+    })
+    function dropdown(that){
+        var oEvent = arguments.callee.caller.arguments[0] || event;
+        oEvent.stopPropagation();
+        var offset = $(that).offset();
+        var top=offset.top-$(window).scrollTop();
+        var index = $(that).parents('tr').data('index');
+        $('.layui-nav-child').each(function (key) {
+            if (key != index) {
+                $(this).hide();
+            }
         })
-    });
+        if($(document).height() < top+$(that).next('ul').height()){
+            $(that).next('ul').css({
+                'padding': 10,
+                'top': - ($(that).parents('td').height() / 2 + $(that).height() + $(that).next('ul').height()/2),
+                'min-width': 'inherit',
+                'position': 'absolute'
+            }).toggle();
+        }else{
+            $(that).next('ul').css({
+                'padding': 10,
+                'top':$(that).parents('td').height() / 2 + $(that).height(),
+                'min-width': 'inherit',
+                'position': 'absolute'
+            }).toggle();
+        }
+    }
+    layList.tool(function (event,data,obj) {
+        switch (event) {
+            case 'send':
+                var url =layList.U({c:'user.user_notice',a:'send',p:{id:data.id}});
+                $eb.$swal('delete',function(){
+                    $eb.axios.get(url).then(function(res){
+                        if(res.status == 200 && res.data.code == 200) {
+                            $eb.$swal('success',res.data.msg);
+                            obj.update({is_send:1,send_time:'{:date("Y-m-d H:i:s",time())}'});
+                        }else
+                            return Promise.reject(res.data.msg || '发送失败')
+                    }).catch(function(err){
+                        $eb.$swal('error',err);
+                    });
+                },{
+                    title:"您确定要发送这条信息吗",
+                    text:"发送后将无法修改通知信息,请谨慎操作!",
+                    confirm:"是的,我要发送!",
+                    cancel:"让我再考虑一下"
+                })
+                break;
+            case 'warning':
+                window.t = $(this);
+                var _this = $(this),url =layList.U({a:'delete',p:{id:data.id}});
+                $eb.$swal('delete',function(){
+                    $eb.axios.get(url).then(function(res){
+                        if(res.status == 200 && res.data.code == 200) {
+                            $eb.$swal('success',res.data.msg);
+                            _this.parents('tr').remove();
+                        }else
+                            return Promise.reject(res.data.msg || '删除失败')
+                    }).catch(function(err){
+                        $eb.$swal('error',err);
+                    });
+                })
+                break;
+        }
+    })
     $('.head_image').on('click',function (e) {
         var image = $(this).data('image');
         $eb.openImage(image);

+ 2 - 3
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());
             }

+ 6 - 1
application/routine/model/user/RoutineUser.php

@@ -41,7 +41,12 @@ class RoutineUser extends ModelBasic
         }else if(WechatUser::be(['routine_openid'=>$routineInfo['routine_openid']])){ //根据小程序openid判断
             WechatUser::edit($routineInfo,$routineInfo['routine_openid'],'routine_openid');
             $uid = WechatUser::where('routine_openid',$routineInfo['routine_openid'])->value('uid');
-            User::updateWechatUser($routineInfo,$uid);
+            if(!User::be(['uid'=>$uid])){
+                $routineInfo = WechatUser::where('uid',$uid)->find();
+                User::setRoutineUser($routineInfo);
+            }else{
+                User::updateWechatUser($routineInfo,$uid);
+            }
         }else{
             $routineInfo['add_time'] = time();//用户添加时间
             $routineInfo = WechatUser::set($routineInfo);

+ 1 - 1
application/version.php

@@ -1,2 +1,2 @@
-version=v2.5.2
+version=CRMEB-DTKY v2.5.2
 version_code=129

+ 3 - 1
application/wap/view/first/index/index.html

@@ -15,7 +15,7 @@
 <div class="page-index" id="app-index">
     <section ref="bsDom">
         <div>
-            
+
             <!--<div class="search-wrapper">
                 <form method="post" @submit.prevent="goSearch">
                     <div class="search-box flex"><input type="text" v-model="keyword" placeholder="商品搜索: 请输入商品关键词"> <a
@@ -93,6 +93,8 @@
                     <li class="flex">
                         <div class="picture"><img src="{$vo.image}" alt="">
                             <div class="count-down flex countdown" data-time="{$vo.stop_time|date='Y/m/d H:i:s',###}">
+                                <span class="days">00</span>
+                                <em>:</em>
                                 <span class="hours">00</span>
                                 <em>:</em>
                                 <span class="minutes">00</span>

+ 2 - 8
application/wap/view/first/my/index.html

@@ -78,13 +78,7 @@
                 </a>
             </div>
             {/volist}
-            {eq name="userInfo.is_promoter" value="1"}
-            <?php /*  <div class="item">
-                  <a class="con-cell" href="/wap/my/user_pro.html">
-                      <img src="/public/uploads/common/5abc57ea40c8c.png" alt="">
-                      <p>我的余额</p>
-                  </a>
-              </div>  */ ?>
+            {if condition="$statu == 2 || $userInfo['is_promoter'] == 1"}
             <div class="item">
                 <a class="con-cell" href="/wap/my/spread_list.html">
                     <img src="/public/uploads/common/5abc5804670d2.png" alt="">
@@ -97,7 +91,7 @@
                     <p>推广二维码</p>
                 </a>
             </div>
-            {/eq}
+            {/if}
         </div>
     </section>
     {include file="public/store_menu"}

+ 2 - 0
application/wap/view/first/store/seckill_index.html

@@ -25,6 +25,8 @@
                                 <p class="count-wrappr"><span>限量{$vo.stock}件</span>  <span class="old-price">市场价:{$vo.ot_price}</span></p>
                                 <div class="time-wrapper">
                                     <div class="countdown" data-time="{$vo.stop_time|date='Y/m/d H:i:s',###}">
+                                        <span class="days" style="background-color: #ec0707; width:.40rem;">00</span>
+                                        <i>:</i>
                                         <span class="hours" style="background-color: #ec0707; width:.40rem;">00</span>
                                         <i>:</i>
                                         <span class="minutes" style="background-color: #ec0707; width:.40rem;">00</span>

+ 159 - 0
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)
+    {
+
+    }
 }

+ 10 - 1
extend/behavior/wechat/UserBehavior.php

@@ -21,7 +21,16 @@ class UserBehavior
     public static function wechatOauthAfter($openid,$wechatInfo)
     {
         Cookie::set('is_login',1);
-        if(WechatUser::be(['openid'=>$wechatInfo['openid']])){
+        if($wechatInfo['unionid'] != '' && WechatUser::be(['unionid'=>$wechatInfo['unionid']])){
+            WechatUser::edit($wechatInfo,$wechatInfo['unionid'],'unionid');
+            $uid = WechatUser::where('unionid',$wechatInfo['unionid'])->value('uid');
+            if(!User::be(['uid'=>$uid])){
+                $wechatInfo = WechatUser::where('uid',$uid)->find();
+                User::setWechatUser($wechatInfo);
+            }else{
+                User::updateWechatUser($wechatInfo,$uid);
+            }
+        }else if(WechatUser::be(['openid'=>$wechatInfo['openid']])){
             WechatUser::edit($wechatInfo,$wechatInfo['openid'],'openid');
             User::updateWechatUser($wechatInfo,WechatUser::openidToUid($wechatInfo['openid']));
         }else{

+ 3 - 3
extend/service/WechatTemplateService.php

@@ -53,10 +53,10 @@ class WechatTemplateService
 
     public static function sendTemplate($openid,$templateId,array $data,$url = null,$defaultColor = '')
     {
-        $templateinfo = WechatTemplateModel::where('tempkey',$templateId)->where('status',1)->find();
-        if(!$templateinfo) return false;
+        $tempid = WechatTemplateModel::where('tempkey',$templateId)->where('status',1)->value('tempid');
+        if(!$tempid) return false;
         try{
-            return WechatService::sendTemplate($openid,$templateinfo['tempid'],$data,$url,$defaultColor);
+            return WechatService::sendTemplate($openid,$tempid,$data,$url,$defaultColor);
         }catch (\Exception $e){
             return false;
         }

+ 4 - 0
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('方法不存在!');

Разница между файлами не показана из-за своего большого размера
+ 6 - 13
public/install/crmeb.sql


+ 1 - 1
public/install/templates/step5.php

@@ -33,7 +33,7 @@ $(function(){
 	$.ajax({
 	type: "POST",
 	url: "http://shop.crmeb.net/index.php/admin/server.upgrade_api/updatewebinfo",
-	data: {host:'<?php echo $host;?>',https:'<?php echo 'http://'.$host;?>',version:'v2.5.8',ip:'<?php echo $_SERVER[HTTP_CLIENT_IP];?>'},
+	data: {host:'<?php echo $host;?>',https:'<?php echo 'http://'.$host;?>',version:'CRMEB-DTKY v2.5.2',ip:'<?php echo $_SERVER[HTTP_CLIENT_IP];?>'},
 	dataType: 'json',
 	success: function(){}
 	});

+ 2 - 2
public/wap/first/crmeb/css/style.css

@@ -981,7 +981,7 @@ label.skin-lable{position:absolute;right:.24rem;top:.33rem;z-index:2}
 .page-index .hotspike-list ul li .picture .count-down{position:absolute;bottom:0;left:0;width:100%;height:.5rem;background-color:rgba(238,238,238,.6);font-size:0;-webkit-box-align:center;-moz-box-align:center;-o-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}
 .page-index .hotspike-list ul li .picture .count-down em,.page-index .hotspike-list ul li .picture .count-down span{font-size:.22rem}
 .page-index .hotspike-list ul li .picture .count-down span{width:.32rem;height:.32rem;border-radius:3px;background-color:#333;color:#fff;text-align:center;line-height:.32rem}
-.page-index .hotspike-list ul li .picture .count-down em{width:.22rem;text-align:center}
+.page-index .hotspike-list ul li .picture .count-down em{width:.12rem;text-align:center}
 .page-index .hotspike-list ul li .text-info{width:4.15rem;height:1.9rem;-webkit-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center}
 .page-index .hotspike-list ul li .text-info .title{display:-webkit-box;display:-moz-box;overflow:hidden;line-height:1.5;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-line-clamp:2;-moz-line-clamp:2}
 .page-index .hotspike-list ul li .text-info .price-wrapper{margin:.2rem 0}
@@ -1136,7 +1136,7 @@ label.skin-lable{position:absolute;right:.24rem;top:.33rem;z-index:2}
 .page-index .search-wrapper .search-box .home-btn .count-num{position:absolute;right:-5px;top:-2px;display:block;min-width:8px;height:8px;line-height:10px;text-align:center;background-color:#fff;color:#eb2f32;font-size:10px;border-radius:10px;padding:2px}
 .page-index .nav{width:100%;padding-bottom:.2rem;background-repeat:no-repeat;-webkit-background-size:100% auto;-moz-background-size:100% auto;background-size:100% auto}
 .page-index .nav ul{-webkit-box-align:center;-moz-box-align:center;-o-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-box-lines:multiple;-moz-box-lines:multiple;-o-box-lines:multiple;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}
-.page-index .nav li{-webkit-box-flex:1;-moz-box-flex:1;-o-box-flex:1;box-flex:1;-webkit-flex:1 25%;-ms-flex:1 25%;flex:1 25%;margin-top:.2rem;text-align:center}
+.page-index .nav li{-webkit-box-flex:1;-moz-box-flex:1;-o-box-flex:1;box-flex:1;-webkit-flex:1 20%;-ms-flex:1 20%;flex:1 20%;margin-top:.2rem;text-align:center}
 .page-index .nav li img{width:.96rem;height:.96rem;border-radius:50%}
 .page-index .nav li p{margin-top:.1rem;font-size:.22rem}
 .common-slider-nav{background-color:#fff;overflow:hidden;font-size:.22rem}

Разница между файлами не показана из-за своего большого размера
+ 17 - 2
update.sql


+ 1 - 0
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 表单提交成功!