作者 anyv
1 个管道 的构建 通过 耗费 22 秒

25

@@ -75,6 +75,25 @@ class SalesmangoodsController extends AdminBaseController{ @@ -75,6 +75,25 @@ class SalesmangoodsController extends AdminBaseController{
75 75
76 } 76 }
77 77
  78 + /**
  79 + * 业务员商品列删除
  80 + */
  81 + public function salesman_del(){
  82 +
  83 + $data = Db::name('goods') -> delete($_POST['id']);
  84 + //删除浏览记录
  85 + Db::name('browsing_history') -> where('goods_id',$_POST['id']) -> delete();
  86 + //删除收藏
  87 + Db::name('collect') -> where('goods_id',$_POST['id']) -> delete();
  88 + //删除购物车
  89 + Db::name('shopping_cart') -> where('goods_id',$_POST['id']) -> delete();
  90 + if($data){
  91 + return true;
  92 + }else{
  93 + return false;
  94 + }
  95 +
  96 + }
78 97
79 98
80 99
@@ -429,6 +429,7 @@ class PersonalcenterController extends WeChatBaseController{ @@ -429,6 +429,7 @@ class PersonalcenterController extends WeChatBaseController{
429 foreach ($money_expend as $key => $val){ 429 foreach ($money_expend as $key => $val){
430 $money += $val['money']; 430 $money += $val['money'];
431 } 431 }
  432 + $money = number_format($money,2);
432 if($data){ 433 if($data){
433 return $money; 434 return $money;
434 }else{ 435 }else{
@@ -449,7 +450,7 @@ class PersonalcenterController extends WeChatBaseController{ @@ -449,7 +450,7 @@ class PersonalcenterController extends WeChatBaseController{
449 $student = Db::name('my_user') -> alias('a') -> field("a.*,b.user_nickname,b.avatar") -> join("user b","a.uid = b.id",'LEFT') -> where("a.pid",$my_user['id']) -> select() -> toArray(); 450 $student = Db::name('my_user') -> alias('a') -> field("a.*,b.user_nickname,b.avatar") -> join("user b","a.uid = b.id",'LEFT') -> where("a.pid",$my_user['id']) -> select() -> toArray();
450 if(!empty($student)){ 451 if(!empty($student)){
451 foreach ($student as $key => $val){ 452 foreach ($student as $key => $val){
452 - $student[$key]['indent'] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray(); 453 + $student[$key]['indent'] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> order("pay_time desc") -> select() -> toArray();
453 $name = $val['user_nickname']; 454 $name = $val['user_nickname'];
454 $avatar = $val['avatar']; 455 $avatar = $val['avatar'];
455 $cumulative_money = 0; 456 $cumulative_money = 0;
@@ -461,10 +462,10 @@ class PersonalcenterController extends WeChatBaseController{ @@ -461,10 +462,10 @@ class PersonalcenterController extends WeChatBaseController{
461 foreach ($money_income as $key2 => $val2){ 462 foreach ($money_income as $key2 => $val2){
462 $money += $val2['money']; 463 $money += $val2['money'];
463 } 464 }
464 - $student[$key]['indent'][$key1]['total_money'] = $money; 465 + $student[$key]['indent'][$key1]['total_money'] = number_format($money,2);
465 $cumulative_money += $money; 466 $cumulative_money += $money;
466 } 467 }
467 - $student[$key]['cumulative_money'] = $cumulative_money; 468 + $student[$key]['cumulative_money'] = number_format($cumulative_money,2);
468 469
469 } 470 }
470 }else{ 471 }else{
@@ -557,7 +558,7 @@ class PersonalcenterController extends WeChatBaseController{ @@ -557,7 +558,7 @@ class PersonalcenterController extends WeChatBaseController{
557 $teacher_avatar = Db::name('user') -> where('id',$uid) -> find(); 558 $teacher_avatar = Db::name('user') -> where('id',$uid) -> find();
558 if(!empty($get['startime']) && !empty($get['endtime'])){ 559 if(!empty($get['startime']) && !empty($get['endtime'])){
559 $startime = strtotime($get['startime']); 560 $startime = strtotime($get['startime']);
560 - $endtime = strtotime($get['endtime']); 561 + $endtime = strtotime($get['endtime'])+86400;
561 $teacher = Db::name('indent') -> where('uid',$uid) -> where("pay_time>=".$startime." and pay_time<=".$endtime) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray(); 562 $teacher = Db::name('indent') -> where('uid',$uid) -> where("pay_time>=".$startime." and pay_time<=".$endtime) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray();
562 }else{ 563 }else{
563 $teacher = Db::name('indent') -> where('uid',$uid) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray(); 564 $teacher = Db::name('indent') -> where('uid',$uid) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray();
@@ -592,8 +593,17 @@ class PersonalcenterController extends WeChatBaseController{ @@ -592,8 +593,17 @@ class PersonalcenterController extends WeChatBaseController{
592 $yewu[] = $val; 593 $yewu[] = $val;
593 } 594 }
594 } 595 }
595 - $this -> assign('pingtai',$pingtai);  
596 - $this -> assign('yewu',$yewu); 596 + if(empty($pingtai)){
  597 + $this -> assign('pingtai',array());
  598 + }else{
  599 + $this -> assign('pingtai',$pingtai);
  600 + }
  601 + if(empty($yewu)){
  602 + $this -> assign('yewu',array());
  603 + }else{
  604 + $this -> assign('yewu',$yewu);
  605 + }
  606 +
597 }else{ 607 }else{
598 $this -> assign('pingtai',array()); 608 $this -> assign('pingtai',array());
599 $this -> assign('yewu',array()); 609 $this -> assign('yewu',array());
@@ -39,15 +39,16 @@ @@ -39,15 +39,16 @@
39 </thead> 39 </thead>
40 <tbody> 40 <tbody>
41 <volist name="data" id="vo"> 41 <volist name="data" id="vo">
42 - <tr> 42 + <tr class="tr{$vo.id}">
43 <td>{$vo.id}</td> 43 <td>{$vo.id}</td>
44 <td>{$vo.book_name}</td> 44 <td>{$vo.book_name}</td>
45 <td>{$vo.user_nickname}</td> 45 <td>{$vo.user_nickname}</td>
46 <td>{$vo.price}</td> 46 <td>{$vo.price}</td>
47 <td>{$vo.sales}</td> 47 <td>{$vo.sales}</td>
48 <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td> 48 <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
49 - <td> 49 + <td style="width: 150px;">
50 <a href="{:url('Salesmangoods/salesman_edit',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">编辑</button></a> 50 <a href="{:url('Salesmangoods/salesman_edit',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">编辑</button></a>
  51 + <button type="button" class="btn btn-default" onclick="sdel({$vo.id})">删除</button>
51 </td> 52 </td>
52 </tr> 53 </tr>
53 </volist> 54 </volist>
@@ -58,5 +59,22 @@ @@ -58,5 +59,22 @@
58 </div> 59 </div>
59 </div> 60 </div>
60 <script src="__STATIC__/js/admin.js"></script> 61 <script src="__STATIC__/js/admin.js"></script>
  62 +<script>
  63 + /**
  64 + *点击删除
  65 + */
  66 + function sdel(id){
  67 + ccc = window.confirm("是否删除?");
  68 + if(ccc){
  69 + $.post("{:url('Salesmangoods/salesman_del')}",{id:id},function(data){
  70 + if(data){
  71 + $('.tr'+id).remove();
  72 + }else{
  73 + alert('删除失败!');
  74 + }
  75 + });
  76 + }
  77 + }
  78 +</script>
61 </body> 79 </body>
62 </html> 80 </html>
@@ -1009,7 +1009,7 @@ @@ -1009,7 +1009,7 @@
1009 "\t\t\t\t\t\t\t\t\t\t</a>"; 1009 "\t\t\t\t\t\t\t\t\t\t</a>";
1010 } else { 1010 } else {
1011 var html_bottom = "<a href=\"{:url('logistics/index','',false,true)}/indent_id/" + result[i].id + "\">\n" + 1011 var html_bottom = "<a href=\"{:url('logistics/index','',false,true)}/indent_id/" + result[i].id + "\">\n" +
1012 - " <div class=\"log_three_bottom2\" data-indent-id=\"{$vo.id}\" style='margin-right: 15px;'>\n" + 1012 + " <div class=\"log_three_bottom2\" data-indent-id=\""+ result[i].id +"\" style='margin-right: 15px;'>\n" +
1013 " 查看物流\n" + 1013 " 查看物流\n" +
1014 " </div>\n" + 1014 " </div>\n" +
1015 " </a><div class=\"take_one\" data-indent-id=\"" + result[i].id + "\">\n" + 1015 " </a><div class=\"take_one\" data-indent-id=\"" + result[i].id + "\">\n" +
@@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
98 <img src="__TMPL__/public/assets/images/62.png" alt="" /> 98 <img src="__TMPL__/public/assets/images/62.png" alt="" />
99 </div> 99 </div>
100 <div class="nine_money_explain_title"> 100 <div class="nine_money_explain_title">
101 - 正在提现额度<span id="tixian_money">{$money}</span> 101 + 正在提现:<span id="tixian_money">{$money}</span>
102 </div> 102 </div>
103 </div> 103 </div>
104 </div> 104 </div>
@@ -273,6 +273,7 @@ @@ -273,6 +273,7 @@
273 $.post("{:url('Personalcenter/add_money_expend')}",{money:money},function(data){ 273 $.post("{:url('Personalcenter/add_money_expend')}",{money:money},function(data){
274 if(data){ 274 if(data){
275 $('#tixian_money').text(data); 275 $('#tixian_money').text(data);
  276 + $('#money').val('');
276 }else{ 277 }else{
277 alert('提交提现失败!'); 278 alert('提交提现失败!');
278 } 279 }
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> 5 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
6 <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" /> 6 <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
7 <meta http-equiv="X-UA-Compatible" content="ie=edge" /> 7 <meta http-equiv="X-UA-Compatible" content="ie=edge" />
8 - <title>学考无忧-我的-完善个人信息</title> 8 + <title>学考无忧-我的-管理页面</title>
9 <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" /> 9 <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
10 <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" /> 10 <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" />
11 <style> 11 <style>