Browse Source

修改后台和接口

Your Name 1 week ago
parent
commit
6fca40c0cd

+ 3
- 0
app/admin/logic/shop/StoreLogic.php View File

@@ -41,6 +41,9 @@ class StoreLogic extends Logic
41 41
             if (isset($get['is_recommend']) && $get['is_recommend'] != '')
42 42
                 $where[] = ['is_recommend', '=', $get['is_recommend']];
43 43
 
44
+            if (isset($get['hksy_type']) && $get['hksy_type'] != '')
45
+                $where[] = ['hksy_type', '=', $get['hksy_type']];
46
+
44 47
             if (isset($get['is_run']) && $get['is_run'] != '')
45 48
                 $where[] = ['is_run', '=', $get['is_run']];
46 49
 

+ 1
- 1
app/admin/view/shop/store/edit.html View File

@@ -143,7 +143,7 @@
143 143
             </div>
144 144
             <!-- 2、经营设置 -->
145 145
             <div class="layui-tab-item">
146
-                <div class="layui-form-item">
146
+                <div class="layui-form-item" style="display: none;">
147 147
                     <label for="expire_time" class="layui-form-label"><span style="color:red;">*</span>到期时间:</label>
148 148
                     <div class="layui-input-inline">
149 149
                         <input type="text" name="expire_time" id="expire_time" value="{$detail.expire_time}"

+ 22
- 2
app/admin/view/shop/store/lists.html View File

@@ -82,6 +82,16 @@
82 82
                         </select>
83 83
                     </div>
84 84
                 </div>
85
+                <div class="layui-inline">
86
+                    <label for="hksy_type" class="layui-form-label">商家套餐:</label>
87
+                    <div class="layui-input-inline">
88
+                        <select name="hksy_type" id="hksy_type">
89
+                            <option value="">全部</option>
90
+                            <option value="0">包月</option>
91
+                            <option value="1">按量付费</option>
92
+                        </select>
93
+                    </div>
94
+                </div>
85 95
                 <div class="layui-inline">
86 96
                     <label for="is_freeze" class="layui-form-label">到期状态:</label>
87 97
                     <div class="layui-input-inline">
@@ -135,6 +145,16 @@
135 145
                 <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="set">设置</a>
136 146
                 <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="account">账号管理</a>
137 147
             </script>
148
+
149
+            <script type="text/html" id="table-store">
150
+                <p>账号:{{ d.account }}</p>
151
+                {{# if(d.hksy_type == 0){ }}
152
+                    <p>类型:<font style="color: red;">包月</font></p>
153
+                {{# } }}
154
+                {{# if(d.hksy_type == 1){ }}
155
+                    <p>类型:<font style="color: blue;">按量付费</font></p>
156
+                {{# } }}
157
+            </script>
138 158
         </div>
139 159
 
140 160
     </div>
@@ -164,14 +184,14 @@
164 184
             {type: 'checkbox'}
165 185
             ,{field:"id", width:60, title:"ID"}
166 186
             ,{field:"storeInfo", width:250, title:"商家信息", templet:"#table-storeInfo"}
167
-            ,{field:"account", width:100, align:"center",title:"商家账号"}
187
+            ,{field:"account", width:100, align:"center",title:"商家账号", templet:"#table-store"}
168 188
             ,{field:"category", width:100, align:"center", title:"主营类目"}
169 189
             ,{field:"is_run", width:90, align:"center", title:"营业状态"}
170 190
             ,{field:"is_freeze", width:90, align:"center", title:"商家状态"}
171 191
             //,{field:"is_recommend", width:90, align:"center", title:"推荐商家"}
192
+            ,{field:"expire_desc", width:160, align:"center", title:"到期状态"}
172 193
             ,{field:"hksy_count", width:90, align:"center", title:"评论次数"}
173 194
             ,{field:"create_time", width:160, align:"center", title:"开通日期"}
174
-            ,{field:"expire_desc", width:160, align:"center", title:"到期状态"}
175 195
             ,{field:"expire_time", width:160, align:"center", title:"到期时间"}
176 196
             ,{title:"操作", width:250, align:"center", fixed:"right", toolbar:"#table-operation"}
177 197
         ]);

+ 41
- 2
app/api/logic/ShopContentLogic.php View File

@@ -96,15 +96,18 @@ class ShopContentLogic extends Logic
96 96
             //dump($expire_time);
97 97
             //echo $expire_time;die;
98 98
 
99
+            /***
100
+             * 原先这是 先判断是否到期 未到期 不扣次数  已到期 判断剩余数量
101
+             *
99 102
             if($expire_time < time()){
100 103
                 //判断到期时间
101 104
                 $data = [
102 105
                    'status' => 107,
103 106
                    'msg' => "商户服务当前套餐到期,到期时间".date('Y-m-d H:i:s',$expire_time)."!"
104 107
                 ];
105
-                //判断剩余数量  hksy_count  当商家已到期
108
+                //当商家已到期
106 109
                 if((int)$shop['hksy_count'] < 10){
107
-                    //判断到期时间
110
+                    //判断剩余数量  hksy_count
108 111
                     $data = [
109 112
                         'status' => 113,
110 113
                         'msg' => "商户服务可评论次数不足,剩余".$shop['hksy_count']."条,请充值后再使用 或 开通商户包年包月服务!"
@@ -117,6 +120,34 @@ class ShopContentLogic extends Logic
117 120
                 $is_gi = 0;
118 121
             }
119 122
             //未到期 不需要扣次数 继续执行即可
123
+             * */
124
+
125
+            //判断类型
126
+            if((int)$shop['hksy_type'] === 0){
127
+                //包月
128
+                if($expire_time < time()){
129
+                    //判断到期时间
130
+                    $data = [
131
+                        'status' => 107,
132
+                        'msg' => "商户服务当前套餐到期,到期时间".date('Y-m-d H:i:s',$expire_time)."!"
133
+                    ];
134
+                    return $data;
135
+                }
136
+                //包月 未过期  = 前端会按包月模式 运行
137
+                $is_gi = 0;
138
+            }else{
139
+                //按量
140
+                if((int)$shop['hksy_count'] < 5){
141
+                    //判断剩余数量  hksy_count
142
+                    $data = [
143
+                        'status' => 113,
144
+                        'msg' => "商户服务可评论次数不足,剩余".$shop['hksy_count']."条,请充值次数后再使用!"
145
+                    ];
146
+                    return $data;
147
+                }
148
+                //按量 统一按过期处理 = 前端会按按量模式 运行
149
+                $is_gi = 1;
150
+            }
120 151
         }
121 152
 
122 153
         if(empty($item))
@@ -881,6 +912,7 @@ class ShopContentLogic extends Logic
881 912
             return false;
882 913
         }
883 914
 
915
+        /*
884 916
         // 判断是否过期
885 917
         $expire_time = $shop->expire_time;
886 918
         //echo $expire_time;die;
@@ -888,6 +920,13 @@ class ShopContentLogic extends Logic
888 920
         if (time() < $expire_time) {
889 921
             //未过期 不进行扣除
890 922
            return true;
923
+        }*/
924
+
925
+        //判断类型
926
+        if((int)$shop->hksy_type === 0){
927
+            self::$errCode = 10;
928
+            self::$error = "商家类型是包月,不允许使用次数!";
929
+            return false;
891 930
         }
892 931
 
893 932
         if ($shop->hksy_count < $count) {

+ 27
- 24
app/shop/view/content/equi_category/lists.html View File

@@ -12,16 +12,6 @@
12 12
   }
13 13
 </style>
14 14
 
15
-<!-- 操作提示 -->
16
-<div class="layui-fluid">
17
-  <div class="layui-card" style="margin-top: 15px;">
18
-    <div class="layui-card-body">
19
-      <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
20
-        <div class="layui-colla-item">
21
-          <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">商户套餐:</h2>
22
-          <div class="layui-colla-content layui-show">
23
-            <p>
24
-
25 15
 {php}
26 16
 $date1 = time();
27 17
 $date2 = strtotime($end_time);
@@ -29,18 +19,39 @@ $date2 = strtotime($end_time);
29 19
 $days = abs($date2 - $date1) / (60 * 60 * 24);
30 20
 $days = intval($days); //取整
31 21
 if($date1 > $date2){
32
-    $days_desc = "已过期".$days."天";
22
+$days_desc = "已过期".$days."天";
33 23
 }else if($days == 0){
34
-    $days_desc = "今天已到期";
24
+$days_desc = "今天已到期";
35 25
 }else{
36
-    $days_desc = "剩余".$days."天";
26
+$days_desc = "剩余".$days."天";
37 27
 }
38 28
 //echo "相差天数:".intval($days); // 输出相差天数,使用intval确保得到整数结果
39 29
 {/php}
40 30
 
41
-                <b>套餐包含:</b> 电脑 <b style="color:#000;">{$server_info.pc_num}</b> 台,每台电脑可添加手机 <b style="color:#000;">{$server_info.mobile_num}</b> 台,可同时运行手机 <b style="color:#000;">{$server_info.run_num}</b> 台。
42
-              <br/>
43
-              总电脑数量:<b style="color:#000;">{$edui_info[0][0]??"0"}</b> 台 &nbsp;&nbsp;&nbsp;&nbsp;
31
+<!-- 操作提示 -->
32
+<div class="layui-fluid">
33
+  <div class="layui-card" style="margin-top: 15px;">
34
+    <div class="layui-card-body">
35
+      <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
36
+        <div class="layui-colla-item">
37
+          <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">
38
+              商户套餐:
39
+              {eq name="hksy_type" value="1"}
40
+              <b style="color:red;">评论次数剩余数量:</b>  <span style="color:red;">{$hksy_count}</span>
41
+              {/eq}
42
+
43
+              {eq name="hksy_type" value="0"}
44
+              <b style="color:red;">服务到期时间:</b>  <span style="color:red;">{$end_time} ({$days_desc})</span>
45
+              {/eq}
46
+          </h2>
47
+          <div class="layui-colla-content layui-show">
48
+            <p>
49
+
50
+                <b>商户类型:</b>{eq name="hksy_type" value="1"}按量付费{/eq} {eq name="hksy_type" value="0"}包月{/eq}
51
+                <b style="margin-left:20px;">套餐包含:</b> 电脑 <b style="color:#000;">{$server_info.pc_num}</b> 台,每台电脑可添加手机 <b style="color:#000;">{$server_info.mobile_num}</b> 台,可同时运行手机 <b style="color:#000;">{$server_info.run_num}</b> 台。
52
+              <hr/>
53
+
54
+              <b>总电脑数量:</b><b style="color:#000;">{$edui_info[0][0]??"0"}</b> 台 &nbsp;&nbsp;&nbsp;&nbsp;
44 55
 
45 56
               <br>
46 57
 
@@ -48,14 +59,6 @@ if($date1 > $date2){
48 59
                 第 <b style="color:#000;">{$vo[1]}</b> 台电脑,总共 <b style="color:#000;">{$vo[2]}</b> 台手机设备,已启用 <b style="color:#000;">{$vo[3]}</b> 台手机设备,未启用 <b style="color:#000;">{$vo[4]}</b> 台手机设备,可同时运行手机 <b style="color:#000;">{$server_info.run_num}</b> 台。 <br/>
49 60
               {/volist}
50 61
 
51
-              {eq name="hksy_type" value="1"}
52
-              <b style="color:red;">评论次数剩余数量:</b>  <span style="color:red;">{$hksy_count}</span>
53
-              {/eq}
54
-
55
-              {eq name="hksy_type" value="0"}
56
-              <b style="color:red;">服务到期时间:</b>  <span style="color:red;">{$end_time} ({$days_desc})</span>
57
-              {/eq}
58
-              <br/>
59 62
             </p>
60 63
           </div>
61 64
         </div>

Loading…
Cancel
Save