正在显示
4 个修改的文件
包含
23 行增加
和
10 行删除
@@ -149,11 +149,7 @@ class OrderpageController extends WeChatBaseController{ | @@ -149,11 +149,7 @@ class OrderpageController extends WeChatBaseController{ | ||
149 | 149 | ||
150 | $_POST['is_courier'] = 2; | 150 | $_POST['is_courier'] = 2; |
151 | $data_update = Db::name('indent') -> update($_POST); | 151 | $data_update = Db::name('indent') -> update($_POST); |
152 | - if($data_update){ | ||
153 | return true; | 152 | return true; |
154 | - }else{ | ||
155 | - return false; | ||
156 | - } | ||
157 | 153 | ||
158 | } | 154 | } |
159 | 155 | ||
@@ -178,11 +174,7 @@ class OrderpageController extends WeChatBaseController{ | @@ -178,11 +174,7 @@ class OrderpageController extends WeChatBaseController{ | ||
178 | public function goods_leave_word_update(){ | 174 | public function goods_leave_word_update(){ |
179 | 175 | ||
180 | $data = Db::name('indent') -> update($_POST); | 176 | $data = Db::name('indent') -> update($_POST); |
181 | - if($data){ | ||
182 | return true; | 177 | return true; |
183 | - }else{ | ||
184 | - return false; | ||
185 | - } | ||
186 | 178 | ||
187 | } | 179 | } |
188 | 180 |
@@ -190,6 +190,20 @@ class ShopcartController extends WeChatBaseController{ | @@ -190,6 +190,20 @@ class ShopcartController extends WeChatBaseController{ | ||
190 | 190 | ||
191 | } | 191 | } |
192 | 192 | ||
193 | + /** | ||
194 | + * 业务员不能买书 | ||
195 | + */ | ||
196 | + public function is_to_pay(){ | ||
197 | + | ||
198 | + $uid = cmf_get_current_user_id(); | ||
199 | + $my_user = Db::name('my_user') -> where('uid',$uid) -> find(); | ||
200 | + if($my_user['status'] == 2){ | ||
201 | + return false; | ||
202 | + }else{ | ||
203 | + return true; | ||
204 | + } | ||
205 | + | ||
206 | + } | ||
193 | 207 | ||
194 | 208 | ||
195 | 209 |
@@ -140,6 +140,8 @@ | @@ -140,6 +140,8 @@ | ||
140 | if(goods_id.length == 0){ | 140 | if(goods_id.length == 0){ |
141 | alert('不能为空'); | 141 | alert('不能为空'); |
142 | }else{ | 142 | }else{ |
143 | + $.post("{:url('Shopcart/is_to_pay')}",{},function(data){ | ||
144 | + if(data){ | ||
143 | goods_id = goods_id.join(','); | 145 | goods_id = goods_id.join(','); |
144 | myprice = $('#myprice').text(); | 146 | myprice = $('#myprice').text(); |
145 | $.post("{:url('Shopcart/shop_cart_pay')}",{id:goods_id,myprice:myprice},function(data){ | 147 | $.post("{:url('Shopcart/shop_cart_pay')}",{id:goods_id,myprice:myprice},function(data){ |
@@ -153,6 +155,11 @@ | @@ -153,6 +155,11 @@ | ||
153 | } | 155 | } |
154 | 156 | ||
155 | }); | 157 | }); |
158 | + }else{ | ||
159 | + alert('业务员不能购买书籍'); | ||
160 | + } | ||
161 | + }); | ||
162 | + | ||
156 | 163 | ||
157 | } | 164 | } |
158 | 165 |
@@ -204,8 +204,8 @@ class WeChatBaseController extends BaseController | @@ -204,8 +204,8 @@ class WeChatBaseController extends BaseController | ||
204 | */ | 204 | */ |
205 | public function checkWeChatUserLogin() | 205 | public function checkWeChatUserLogin() |
206 | { | 206 | { |
207 | - $user = Db::name('user')->where('id',2)->find(); | ||
208 | - cmf_update_current_user($user); | 207 | + /*$user = Db::name('user')->where('id',2)->find(); |
208 | + cmf_update_current_user($user);*/ | ||
209 | $userId = cmf_get_current_user_id(); | 209 | $userId = cmf_get_current_user_id(); |
210 | if (empty($userId)) { | 210 | if (empty($userId)) { |
211 | $config = [ | 211 | $config = [ |
-
请 注册 或 登录 后发表评论