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

4

<?php
namespace app\admin\controller;
use app\admin\model\RouteModel;
use cmf\controller\AdminBaseController;
use think\Db;
class AftersaleController extends AdminBaseController{
/**
* 售后咨询显示页
*/
public function index(){
if($this -> request -> isPost()){
Db::name('token') -> where('id',3) -> update(['phone'=>$_POST['phone']]);
}
$phone = Db::name('token') -> where('id',3) -> find();
$this -> assign('phone',$phone);
return $this -> fetch();
}
}
\ No newline at end of file
... ...
... ... @@ -222,6 +222,10 @@ class SalesmanController extends AdminBaseController{
$id = $_POST['id'];
$data = Db::name('goods') -> where('id',$id) -> update(['is_out'=>0]);
//删除购物车 浏览记录 收藏表中下架的数据
Db::name('browsing_history') -> where('goods_id',$id) -> delete();
Db::name('collect') -> where('goods_id',$id) -> delete();
Db::name('shopping_cart') -> where('goods_id',$id) -> delete();
if($data){
return true;
}else{
... ...
... ... @@ -19,17 +19,17 @@ class SalesmangoodsController extends AdminBaseController{
if(!empty($_POST['start_time']) && !empty($_POST['end_time'])){
$start_time = strtotime($_POST['start_time']);
$end_time = strtotime($_POST['end_time']);
$where['create_time'] = [['>=',$start_time],['<=',$end_time]];
$where['a.create_time'] = [['>=',$start_time],['<=',$end_time]];
}
if(!empty($_POST['keyword'])){
$keyword = $_POST['keyword'];
$where['book_name'] = ['like',"%$keyword%"];
$where['a.book_name'] = ['like',"%$keyword%"];
}
$data = Db::name('goods') -> where($where) -> paginate(1000000);
$data = Db::name('goods') -> alias('a') -> field('a.*,b.user_nickname') -> join('user b',"a.uid=b.id",'LEFT') -> where($where) -> paginate(1000000);
$this -> assign('data',$data);
return $this -> fetch();
}else{
$data = Db::name('goods') -> where('type',2) -> paginate(12);
$data = Db::name('goods') -> alias('a') -> field('a.*,b.user_nickname') -> join('user b',"a.uid=b.id",'LEFT') -> where('type',2) -> paginate(12);
$this -> assign('data',$data);
return $this -> fetch();
}
... ...
... ... @@ -77,6 +77,9 @@ class OrderController extends WeChatBaseController
$data['address'] = $address;
$data['indent_goods'] = $indentGoods;
$this->assign('data',$data);
//显示售后咨询手机号
$phone = Db::name('token') -> where('id',3) -> find();
$this -> assign('phone',$phone);
return $this->fetch();
}
public function cancel_order(){
... ...
<?php
return array (
'ADMIN_AFTERSALE_INDEX' => '售后咨询',
'ADMIN_AUDIT_AUDIT_LIST' => '业务员审核',
'ADMIN_GOODS_GOODS_LIST' => '平台商品列表',
'ADMIN_GOODS_INDEX' => '商品管理',
... ...
<include file="public@header"/>
</head>
<body>
<div style="padding: 100px 100px 10px;">
<form class="bs-example bs-example-form" role="form" method="post" action="{:url('Aftersale/index')}">
<div class="input-group" style="width: 100px;">
<span class="input-group-addon">售后咨询</span>
</div>
<br>
<div class="input-group">
<span class="input-group-addon">手机号:</span>
<input type="text" name="phone" class="form-control" value="{$phone.phone}" >
</div>
<br>
<button type="submit" class="btn btn-default" >确定</button>
</form>
</div>
</body>
<script>
/**
*
*/
</script>
</html>
\ No newline at end of file
... ...
... ... @@ -30,6 +30,7 @@
<tr>
<th>序号</th>
<th>商品名称</th>
<th>所属业务员</th>
<th>售价</th>
<th>销量</th>
<th>创建时间</th>
... ... @@ -41,6 +42,7 @@
<tr>
<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>
... ...
... ... @@ -57,7 +57,7 @@
<div class="tx_maskCon2" style="border-radius: 0.1rem;">
<div class="delete_school">
</div>
<div class="dianhua">售后电话:12345678911</div>
<div class="dianhua">售后电话:{$phone.phone}</div>
</div>
</div>
</div>
... ...
... ... @@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController
*/
public function checkWeChatUserLogin()
{
/*$user = Db::name('user')->where('id',29)->find();
/*$user = Db::name('user')->where('id',13)->find();
cmf_update_current_user($user);*/
$userId = cmf_get_current_user_id();
if (empty($userId)) {
... ...