KehuController.php 1.1 KB
<?php
namespace app\admin\controller;

use cmf\controller\AdminBaseController;
use think\Db;
use app\admin\model\AdminMenuModel;

class KehuController extends AdminBaseController{


  //显示客户列表
  public function kehulist(){

    $data = Db::name('customer_data') -> order('status') -> paginate(10);
    $this -> assign('data',$data);
    return $this -> fetch();


  }

  //查看用户资料
  public function khlook(){

    $id = input('post.id');
    $data = Db::name('customer_data') -> where('id',$id) -> find();
    return json_encode($data);

  }

  //修改客户状态
  public function khup(){

    $id = input('post.id');
    $status = input('post.status');
    $data = Db::name('customer_data') -> where('id',$id) -> update(['status'=>$status]);
    if($data){
      return true;
    }else{
      return false;
    }

  }


  //删除客户资料
  public function khdel(){

    $id = input('post.id');
    $data = Db::name('customer_data') -> where('id',$id) -> delete();
    if($data){
      return true;
    }else{
      return false;
    }



  }






}





















 ?>