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

25

... ... @@ -75,6 +75,25 @@ class SalesmangoodsController extends AdminBaseController{
}
/**
* 业务员商品列删除
*/
public function salesman_del(){
$data = Db::name('goods') -> delete($_POST['id']);
//删除浏览记录
Db::name('browsing_history') -> where('goods_id',$_POST['id']) -> delete();
//删除收藏
Db::name('collect') -> where('goods_id',$_POST['id']) -> delete();
//删除购物车
Db::name('shopping_cart') -> where('goods_id',$_POST['id']) -> delete();
if($data){
return true;
}else{
return false;
}
}
... ...
... ... @@ -429,6 +429,7 @@ class PersonalcenterController extends WeChatBaseController{
foreach ($money_expend as $key => $val){
$money += $val['money'];
}
$money = number_format($money,2);
if($data){
return $money;
}else{
... ... @@ -449,7 +450,7 @@ class PersonalcenterController extends WeChatBaseController{
$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();
if(!empty($student)){
foreach ($student as $key => $val){
$student[$key]['indent'] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray();
$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();
$name = $val['user_nickname'];
$avatar = $val['avatar'];
$cumulative_money = 0;
... ... @@ -461,10 +462,10 @@ class PersonalcenterController extends WeChatBaseController{
foreach ($money_income as $key2 => $val2){
$money += $val2['money'];
}
$student[$key]['indent'][$key1]['total_money'] = $money;
$student[$key]['indent'][$key1]['total_money'] = number_format($money,2);
$cumulative_money += $money;
}
$student[$key]['cumulative_money'] = $cumulative_money;
$student[$key]['cumulative_money'] = number_format($cumulative_money,2);
}
}else{
... ... @@ -557,7 +558,7 @@ class PersonalcenterController extends WeChatBaseController{
$teacher_avatar = Db::name('user') -> where('id',$uid) -> find();
if(!empty($get['startime']) && !empty($get['endtime'])){
$startime = strtotime($get['startime']);
$endtime = strtotime($get['endtime']);
$endtime = strtotime($get['endtime'])+86400;
$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();
}else{
$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{
$yewu[] = $val;
}
}
$this -> assign('pingtai',$pingtai);
$this -> assign('yewu',$yewu);
if(empty($pingtai)){
$this -> assign('pingtai',array());
}else{
$this -> assign('pingtai',$pingtai);
}
if(empty($yewu)){
$this -> assign('yewu',array());
}else{
$this -> assign('yewu',$yewu);
}
}else{
$this -> assign('pingtai',array());
$this -> assign('yewu',array());
... ...
... ... @@ -39,15 +39,16 @@
</thead>
<tbody>
<volist name="data" id="vo">
<tr>
<tr class="tr{$vo.id}">
<td>{$vo.id}</td>
<td>{$vo.book_name}</td>
<td>{$vo.user_nickname}</td>
<td>{$vo.price}</td>
<td>{$vo.sales}</td>
<td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
<td>
<td style="width: 150px;">
<a href="{:url('Salesmangoods/salesman_edit',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">编辑</button></a>
<button type="button" class="btn btn-default" onclick="sdel({$vo.id})">删除</button>
</td>
</tr>
</volist>
... ... @@ -58,5 +59,22 @@
</div>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
/**
*点击删除
*/
function sdel(id){
ccc = window.confirm("是否删除?");
if(ccc){
$.post("{:url('Salesmangoods/salesman_del')}",{id:id},function(data){
if(data){
$('.tr'+id).remove();
}else{
alert('删除失败!');
}
});
}
}
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -1009,7 +1009,7 @@
"\t\t\t\t\t\t\t\t\t\t</a>";
} else {
var html_bottom = "<a href=\"{:url('logistics/index','',false,true)}/indent_id/" + result[i].id + "\">\n" +
" <div class=\"log_three_bottom2\" data-indent-id=\"{$vo.id}\" style='margin-right: 15px;'>\n" +
" <div class=\"log_three_bottom2\" data-indent-id=\""+ result[i].id +"\" style='margin-right: 15px;'>\n" +
" 查看物流\n" +
" </div>\n" +
" </a><div class=\"take_one\" data-indent-id=\"" + result[i].id + "\">\n" +
... ...
... ... @@ -98,7 +98,7 @@
<img src="__TMPL__/public/assets/images/62.png" alt="" />
</div>
<div class="nine_money_explain_title">
正在提现额度<span id="tixian_money">{$money}</span>
正在提现:<span id="tixian_money">{$money}</span>
</div>
</div>
</div>
... ... @@ -273,6 +273,7 @@
$.post("{:url('Personalcenter/add_money_expend')}",{money:money},function(data){
if(data){
$('#tixian_money').text(data);
$('#money').val('');
}else{
alert('提交提现失败!');
}
... ...
... ... @@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>学考无忧-我的-完善个人信息</title>
<title>学考无忧-我的-管理页面</title>
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" />
<style>
... ...