public function _initialize()
 {
     parent::_initialize();
     // TODO: Change the autogenerated stub
     $this->DepartMember = D('DepartMember');
     $this->Message = D('Message');
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $str = $_GET['search'];
         $where['outtime'] = array('like', "%{$str}%");
         $where['x.product'] = array('like', "%{$str}%");
         $where['outamount'] = array('like', "%{$str}%");
         $where['outsum'] = array('like', "%{$str}%");
         $where['inamount'] = array('like', "%{$str}%");
         $where['insum'] = array('like', "%{$str}%");
         $where['_logic'] = 'or';
         $map['_complex'] = $where;
         $map['_string'] = "int_id = c.id";
         $order = "outtime desc";
         $this->assign("replace", "<font color='red'>{$str}</font>");
         $this->assign("str", $str);
         parent::showPage("RevenueView", "10", $map, "outtime desc");
         $tbName = D('RevenueView');
         $outsum = $tbName->where($map)->sum("outsum");
         $this->assign("outsum", $outsum);
         $insum = $tbName->where($where)->sum("insum");
         $this->assign("insum", $insum);
         $total = $outsum - $insum;
         $this->assign("total", $total);
         $this->display();
     }
 }
 public function index()
 {
     $rule = D("Rule");
     $res = $rule->select();
     if ($res == "") {
         $res = "没有任何数据";
         $this->assign("res", $res);
     } else {
         $this->assign("res", $res);
         parent::showPage("Rule", "10");
     }
     $this->display();
 }
 public function index()
 {
     $group = D("Group");
     $res = $group->select();
     if ($res == "") {
         $res = "没有任何数据";
         $this->assign("res", $res);
     } else {
         $this->assign("res", $res);
         parent::showPage("Group");
     }
     $this->display();
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $name = trim($_GET['name']);
         if ($name != "") {
             $where['name'] = array('like', "%{$name}%");
             $this->assign("name", $name);
         }
         $title = trim($_GET['title']);
         if ($title != "") {
             $where['title'] = array('like', "%{$title}%");
             $this->assign("title", $title);
         }
         $status = trim($_GET['status']);
         if ($status != "") {
             $where['status'] = array('like', "%{$status}%");
             $this->assign("status", $status);
         }
         $condition = trim($_GET['condition']);
         if ($condition != "") {
             $where['condition'] = array('like', "%{$condition}%");
             $this->assign("condition", $condition);
         }
         parent::showPage("Rule", "10", $where);
         $total = D('Rule')->where($where)->count("id");
         $this->assign("total", $total);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $str = $_GET['search'];
         $where['type'] = array('like', "%{$str}%");
         $this->assign("str", $str);
         parent::showPage("Type", "10", $where);
         $total = D('Type')->where($where)->count("id");
         $this->assign("total", $total);
         $this->display();
     }
 }
 public function searching()
 {
     $model = new Model();
     $sql = "use  " . $_SESSION['dbName'];
     $model->query($sql);
     if (!IS_POST) {
         $this->display();
     } else {
         $shop = trim($_POST['shop']);
         if ($shop != "") {
             $where['shop'] = array('like', "%{$shop}%");
             $this->assign("shop", $shop);
         }
         $tel = trim($_POST['tel']);
         if ($tel != "") {
             $where['tel'] = array('like', "%{$tel}%");
             $this->assign("tel", $tel);
         }
         $address = trim($_POST['address']);
         if ($address != "") {
             $where['address'] = array('like', "%{$address}%");
             $this->assign("address", $address);
         }
         $people = trim($_POST['people']);
         if ($people != "") {
             $where['people'] = array('like', "%{$people}%");
             $this->assign("people", $people);
         }
         parent::showPage("Shop", "10", $where);
         $user = D('Shop');
         $id = $user->where($where)->count("id");
         $this->assign("id", $id);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $bar = trim($_GET['bar']);
         if ($bar != "") {
             $where['barcode'] = array('like', "%{$bar}%");
             $this->assign("bar", $bar);
         }
         $pro = trim($_GET['pro']);
         if ($pro != "") {
             $where['product'] = array('like', "%{$pro}%");
             $this->assign("pro", $pro);
         }
         $let = trim($_GET['let']);
         if ($let != "") {
             $let = strtoupper($let);
             $where['letter'] = array('like', "%{$let}%");
             $this->assign("let", $let);
         }
         $type = trim($_GET['type']);
         if ($type != "") {
             $where['type'] = array('like', "%{$type}%");
             $this->assign("type", $type);
         }
         $stand = trim($_GET['stand']);
         if ($stand != "") {
             $where['standard'] = array('like', "%{$stand}%");
             $this->assign("stand", $stand);
         }
         $unit = trim($_GET['unit']);
         if ($unit != "") {
             $where['unit'] = array('like', "%{$unit}%");
             $this->assign("unit", $unit);
         }
         $price = trim($_GET['price']);
         if ($price != "") {
             $where['price'] = array('like', "%{$price}%");
             $this->assign("price", $price);
         }
         $info = trim($_GET['info']);
         if ($info != "") {
             $where['info'] = array('like', "%{$info}%");
             $this->assign("info", $info);
         }
         parent::showPage("Goods", "10", $where);
         /*
          * 统计商品数量
          */
         $total = D('Goods')->where($where)->count("id");
         $this->assign("total", $total);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $str = $_GET['search'];
         $where['barcode'] = array('like', "%{$str}%");
         $up = strtoupper($str);
         $where['letter'] = array('like', "%{$up}%");
         $where['num'] = array('like', "%{$str}%");
         $where['presell'] = array('like', "%{$str}%");
         $where['_logic'] = 'or';
         $this->assign("replace", "<font color='red'>{$str}</font>");
         $this->assign("str", $str);
         parent::showPage("Presell", "10", $where);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $bar = trim($_GET['barcode']);
         if ($bar != "") {
             $where['barcode'] = array('like', "%{$bar}%");
             $this->assign("bar", $bar);
         }
         $let = trim($_GET['letter']);
         if ($let != "") {
             $let = strtoupper($let);
             $where['letter'] = array('like', "%{$let}%");
             $this->assign("let", $let);
         }
         $amount = trim($_GET['outamount']);
         if ($amount != "") {
             $where['num'] = array('like', "%{$amount}%");
             $this->assign("num", $amount);
         }
         $price = trim($_GET['outprice']);
         if ($price != "") {
             $where['presell'] = array('like', "%{$price}%");
             $this->assign("pre", $price);
         }
         $sum = trim($_GET['outsum']);
         if ($sum != "") {
             $where['amount'] = array('like', "%{$sum}%");
             $this->assign("amount", $sum);
         }
         $people = trim($_GET['confine']);
         if ($people != "") {
             $where['confine'] = array('like', "%{$people}%");
             $this->assign("confine", $people);
         }
         $db_name = session("dbName") . ".Presell";
         parent::showPage($db_name, "10", $where);
         $id = M($db_name)->where($where)->count("id");
         $this->assign("id", $id);
         $this->display();
     }
 }
 public function searching()
 {
     $model = new Model();
     $sql = "use " . $_SESSION['dbName'];
     $model->query($sql);
     $shop_id = $_SESSION['storeId'];
     if (!IS_GET) {
         $this->display();
     } else {
         $str = trim($_GET['search']);
         $bar = trim($_GET['barcode']);
         if ($bar != "") {
             $where['barcode'] = array('like', "%{$bar}%");
             $this->assign("bar", $bar);
         }
         $pro = trim($_GET['product']);
         if ($pro != "") {
             $where['product'] = array('like', "%{$pro}%");
             $this->assign("pro", $pro);
         }
         $let = trim($_GET['letter']);
         if ($let != "") {
             $let = strtoupper($let);
             $where['letter'] = array('like', "%{$let}%");
             $this->assign("let", $let);
         }
         $amount = trim($_GET['outamount']);
         if ($amount != "") {
             $where['outamount'] = array('like', "%{$amount}%");
             $this->assign("amount", $amount);
         }
         $presell = trim($_GET['outpresell']);
         if ($presell != "") {
             $where['outpresell'] = array('like', "%{$presell}%");
             $this->assign("presell", $presell);
         }
         $price = trim($_GET['outprice']);
         if ($price != "") {
             $where['outprice'] = array('like', "%{$price}%");
             $this->assign("price", $price);
         }
         $sum = trim($_GET['outsum']);
         if ($sum != "") {
             $where['outsum'] = array('like', "%{$sum}%");
             $this->assign("sum", $sum);
         }
         $people = trim($_GET['people']);
         if ($people != "") {
             $where['people'] = array('like', "%{$people}%");
             $this->assign("people", $people);
         }
         $start = trim($_GET['start']);
         $end = trim($_GET['end']);
         if ($end != "") {
             $where['outtime'] = array('between', array($start . " 00:00:00", $end . " 59:59:59"));
             $this->assign("date", $people);
         }
         parent::showPage($shop_id . "Storage", "10", $where);
         $tb = D($shop_id . "Storage");
         /*
          * 金额
          */
         $total = $tb->where($where)->sum("outsum");
         $this->assign("total", $total);
         /*
          * 数量
          */
         $num = $tb->where($where)->sum("outamount");
         $this->assign("num", $num);
         /*
          * 单子数
          */
         $id = $tb->where($where)->count("id");
         $this->assign("id", $id);
         $this->display();
     }
 }
 public function searching()
 {
     $model = new Model();
     $sql = "use " . $_SESSION['dbName'];
     $model->query($sql);
     if (!IS_GET) {
         $this->display();
     } else {
         $bar = trim($_GET['barcode']);
         if ($bar != "") {
             $where['barcode'] = array('like', "%{$bar}%");
             $this->assign("bar", $bar);
         }
         $pro = trim($_GET['product']);
         if ($pro != "") {
             $where['product'] = array('like', "%{$pro}%");
             $this->assign("pro", $pro);
         }
         $let = trim($_GET['letter']);
         if ($let != "") {
             $let = strtoupper($let);
             $where['letter'] = array('like', "%{$let}%");
             $this->assign("let", $let);
         }
         $amount = trim($_GET['outamount']);
         if ($amount != "") {
             $where['num'] = array('like', "%{$amount}%");
             $this->assign("num", $amount);
         }
         $price = trim($_GET['outprice']);
         if ($price != "") {
             $where['presell'] = array('like', "%{$price}%");
             $this->assign("pre", $price);
         }
         $sum = trim($_GET['outsum']);
         if ($sum != "") {
             $where['amount'] = array('like', "%{$sum}%");
             $this->assign("amount", $sum);
         }
         //  $map['_complex']=""
         $today = date("Y-m-d");
         $where['saledate'] = array('like', "%{$today}%");
         $where['salesman'] = $_SESSION['nameReal'];
         $shop_id = $_SESSION['storeId'];
         parent::showPage($shop_id . "Sales", "10", $where, "saledate desc");
         $tb = D($shop_id . "Sales");
         $total = $tb->where($where)->sum("amount");
         $this->assign("total", $total);
         /*
          * 金额
          */
         $total = $tb->where($where)->sum("amount");
         $this->assign("total", $total);
         /*
          * 数量
          */
         $num = $tb->where($where)->sum("num");
         $this->assign("sanum", $num);
         /*
          * 单子数
          */
         $id = $tb->where($where)->count("id");
         $this->assign("id", $id);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $str = $_GET['search'];
         $where['product'] = array('like', "%{$str}%");
         $where['letter'] = array('like', "%{$str}%");
         // $where['type'] = array('like', "%$str%");
         $where['barcode'] = array('like', "%{$str}%");
         $where['standard'] = array('like', "%{$str}%");
         $where['unit'] = array('like', "%{$str}%");
         $where['info'] = array('like', "%{$str}%");
         $where['_logic'] = 'or';
         $this->assign("replace", "<font color='red'>{$str}</font>");
         $this->assign("str", $str);
         parent::showPage("Goods", "10", $where);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $str = $_GET['search'];
         $where['name'] = array('like', "%{$str}%");
         $where['pwd'] = array('like', "%{$str}%");
         //$where['regtime'] = array('like', "%$str%");
         //$where['latetime'] = array('like', "%$str%");
         $where['_logic'] = 'or';
         $this->assign("replace", "<font color='red'>{$str}</font>");
         $this->assign("str", $str);
         parent::showPage("User", "10", $where);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $str = $_GET['search'];
         $where['encode'] = array('like', "%{$str}%");
         $up = strtoupper($str);
         $where['letter'] = array('like', "%{$up}%");
         $where['incode'] = array('like', "%{$str}%");
         $where['pro'] = array('like', "%{$str}%");
         $where['intime'] = array('like', "%{$str}%");
         $where['inprice'] = array('like', "%{$str}%");
         $where['inamount'] = array('like', "%{$str}%");
         $where['insum'] = array('like', "%{$str}%");
         $where['people'] = array('like', "%{$str}%");
         $where['_logic'] = 'or';
         $this->assign("replace", "<font color='red'>{$str}</font>");
         $this->assign("str", $str);
         parent::showPage("InView", "10", $where, "intime desc");
         $tb = D("InView");
         $total = $tb->where($where)->sum("insum");
         $this->assign("total", $total);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $name = trim($_GET['name']);
         if ($name != "") {
             $where['name'] = array('like', "%{$name}%");
             $this->assign("name", $name);
         }
         $real = trim($_GET['real']);
         if ($real != "") {
             $where['realName'] = array('like', "%{$real}%");
             $this->assign("real", $real);
         }
         $IDcard = trim($_GET['IDcard']);
         if ($IDcard != "") {
             $where['IDcard'] = array('like', "% {$IDcard}%");
             $this->assign("IDcard", $IDcard);
         }
         $tel = trim($_GET['tel']);
         if ($tel != "") {
             $where['tel'] = array('like', "%{$tel} %");
             $this->assign("tel", $tel);
         }
         $free = trim($_GET['free']);
         if ($free != "") {
             $where['Probation.isfree'] = array('like', "%{$free}%");
             $this->assign("free", $free);
         }
         $toll = trim($_GET['toll']);
         if ($toll != "") {
             $where['istoll'] = array('like', "%{$toll}%");
             $this->assign("toll", $toll);
         }
         $email = trim($_GET['email']);
         if ($email != "") {
             $where['tel'] = array('like', "%{$email}%");
             $this->assign("email", $email);
         }
         $phone = trim($_GET['phone']);
         if ($phone != "") {
             $where['phone'] = array('like', "% {$phone}%");
             $this->assign("phone", $phone);
         }
         $fax = trim($_GET['fax']);
         if ($fax != "") {
             $where['fax'] = array('like', "% {$fax}%");
             $this->assign("fax", $fax);
         }
         $info = trim($_GET['info']);
         if ($info != "") {
             $where['info'] = array('like', "%{$info}%");
             $this->assign("info", $info);
         }
         $address = trim($_GET['address']);
         if ($address != "") {
             $where['address'] = array('like', "%{$address}%");
             $this->assign("address", $address);
         }
         $province = trim($_GET['province']);
         $city = trim($_GET['city']);
         if ($province != "" || $city != "") {
             $area = $province . " - " . $city;
             $where['area'] = array('like', "%{$area}%");
             $this->assign("area", $area);
         }
         $start = trim($_GET['start']);
         $end = trim($_GET['end']);
         if ($start != "" && $end != "") {
             $where['latetime'] = array('between', array($start . " 00:00:00", $end . " 59:59:59"));
             $this->assign("date", $date);
         }
         //$where['redirect'] = "Boss";
         //   parent::showPage("User", "10", $where);
         $where['redirect'] = "Boss";
         parent::showPage("UserView", "10", $where);
         // 满足条件的记录数
         $us = D('UserView');
         $count = $us->where($where)->count("id");
         $this->assign("uscount", $count);
         $this->display();
     }
 }
 public function searching()
 {
     $model = new Model();
     $sql = "use  " . $_SESSION['dbName'];
     $model->query($sql);
     if (!IS_POST) {
         $this->display();
     } else {
         $shop_id = $_POST['shopid'];
         if ($shop_id == "") {
             $shop_id = $_SESSION["shop_id"];
         }
         if ($shop_id == "") {
             $this->error("请先点击具体的店铺,再回来点此!");
         }
         $shopName = $_SESSION["shop_name"];
         $this->assign("shopName", $shopName);
         $bar = trim($_POST['barcode']);
         if ($bar != "") {
             $where['barcode'] = array('like', "%{$bar}%");
             $this->assign("bar", $bar);
         }
         $pro = trim($_POST['product']);
         if ($pro != "") {
             $where['product'] = array('like', "%{$pro}%");
             $this->assign("pro", $pro);
         }
         $let = trim($_POST['letter']);
         if ($let != "") {
             $let = strtoupper($let);
             $where['letter'] = array('like', "%{$let}%");
             $this->assign("let", $let);
         }
         $type = trim($_POST['type']);
         if ($type != "") {
             $where['type'] = array('like', "%{$type}%");
             $this->assign("type", $type);
         }
         $stand = trim($_POST['standard']);
         if ($stand != "") {
             $where['standard'] = array('like', "%{$stand}%");
             $this->assign("stand", $stand);
         }
         $unit = trim($_POST['unit']);
         if ($unit != "") {
             $where['unit'] = array('like', "%{$unit}%");
             $this->assign("unit", $unit);
         }
         $price = trim($_POST['price']);
         if ($price != "") {
             $where['price'] = array('like', "%{$price}%");
             $this->assign("price", $price);
         }
         $info = trim($_POST['info']);
         if ($info != "") {
             $where['info'] = array('like', "%{$info}%");
             $this->assign("info", $info);
         }
         // $where['_logic'] = 'or';
         parent::showPage($shop_id . "Goods", "10", $where);
         $this->assign("shop", U('Goods/index', array('shopid' => $shop_id)));
         $id = D($shop_id . 'Goods')->where($where)->count("id");
         $this->assign("id", $id);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $str = $_GET['search'];
         $where['barcode'] = array('like', "%{$str}%");
         $up = strtoupper($str);
         $where['letter'] = array('like', "%{$up}%");
         $where['product'] = array('like', "%{$str}%");
         $where['num'] = array('like', "%{$str}%");
         $where['amount'] = array('like', "%{$str}%");
         $where['salesman'] = array('like', "%{$str}%");
         $where['presell'] = array('like', "%{$str}%");
         $where['saledate'] = array('like', "%{$str}%");
         $where['_logic'] = 'or';
         $this->assign("replace", "<font color='red'>{$str}</font>");
         $this->assign("str", $str);
         parent::showPage("Sales", "10", $where);
         $tb = D("Sales");
         $total = $tb->where($where)->sum("amount");
         $this->assign("total", $total);
         $this->display();
     }
 }
 public function tollSearch()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $name = trim($_GET['name']);
         if ($name != "") {
             $where['name'] = array('like', "%{$name}%");
             $this->assign("name", $name);
         }
         $IDcard = trim($_GET['status']);
         if ($IDcard != "") {
             $where['istoll'] = array('like', "%{$IDcard}%");
             $this->assign("istoll", $IDcard);
         }
         $area = trim($_GET['freemonth']);
         if ($area != "") {
             $where['tollmonth'] = array('like', "%{$area}%");
             $this->assign("tollmonth", $area);
         }
         $every = trim($_GET['every']);
         if ($every != "") {
             $where['tollevery'] = array('like', "%{$every}%");
             $this->assign("every", $every);
         }
         $sum = trim($_GET['sum']);
         if ($sum != "") {
             $where['tollsum'] = array('like', "%{$sum}%");
             $this->assign("sum", $sum);
         }
         $start = trim($_GET['start']);
         if ($start != "") {
             $where['tolldate'] = array('egt', $start . " 00:00:00");
             $this->assign("date", $start);
         }
         $end = trim($_GET['end']);
         if ($end != "") {
             $where['tollend'] = array('elt', $end . " 59:59:59");
             $this->assign("end", $end);
         }
         parent::showPage("Probation", "10", $where);
         /*
          *  总计金额
          */
         $sumtotal = D("Probation")->where($where)->sum("tollsum");
         $this->assign("sumtotal", $sumtotal);
         /*
          *  总计用户
          */
         $us = D("Probation")->where($where)->count("name");
         $this->assign("us", $us);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $com = trim($_GET['com']);
         if ($com != "") {
             $where['company'] = array('like', "%{$com}%");
             $this->assign("com", $com);
         }
         $bos = trim($_GET['bos']);
         if ($bos != "") {
             $where['boss'] = array('like', "%{$bos}%");
             $this->assign("bos", $bos);
         }
         $bostel = trim($_GET['bostel']);
         if ($bostel != "") {
             $where['bostel'] = array('like', "%{$bostel}%");
             $this->assign("bostel", $bostel);
         }
         $people = trim($_GET['people']);
         if ($people != "") {
             $where['people'] = array('like', "%{$people}%");
             $this->assign("peo", $people);
         }
         $peotel = trim($_GET['peotel']);
         if ($peotel != "") {
             $where['peotel'] = array('like', "%{$peotel}%");
             $this->assign("peotel", $peotel);
         }
         $addr = trim($_GET['addr']);
         if ($addr != "") {
             $where['address'] = array('like', "%{$addr}%");
             $this->assign("addr", $addr);
         }
         $tel = trim($_GET['tel']);
         if ($tel != "") {
             $where['tel'] = array('like', "%{$tel}%");
             $this->assign("tel", $tel);
         }
         $web = trim($_GET['web']);
         if ($web != "") {
             $where['website'] = array('like', "%{$web}%");
             $this->assign("web", $web);
         }
         $info = trim($_GET['info']);
         if ($info != "") {
             $where['info'] = array('like', "%{$info}%");
             $this->assign("info", $info);
         }
         parent::showPage("Company", "10", $where);
         /*
          * 统计商家数量
          */
         $total = D('Company')->where($where)->count("id");
         $this->assign("total", $total);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_POST) {
         $this->display();
     } else {
         $name = trim($_POST['name']);
         if ($name != "") {
             $where['name'] = array('like', "%{$name}%");
             $this->assign("name", $name);
         }
         $tel = trim($_POST['tel']);
         if ($tel != "") {
             $where['tel'] = array('like', "%{$tel}%");
             $this->assign("tel", $tel);
         }
         $real = trim($_POST['real']);
         if ($real != "") {
             $where['realName'] = array('like', "%{$real}%");
             $this->assign("real", $real);
         }
         $card = trim($_POST['card']);
         if ($card != "") {
             $where['IDcard'] = array('like', "%{$card}%");
             $this->assign("card", $card);
         }
         $email = trim($_POST['email']);
         if ($email != "") {
             $where['tel'] = array('like', "%{$email}%");
             $this->assign("email", $email);
         }
         $date = trim($_POST['date']);
         if ($date != "") {
             $where['latetime'] = array('like', "%{$date}%");
             $this->assign("date", $date);
         }
         $status = trim($_POST['status']);
         if ($status != "") {
             $where['status'] = array('like', "%{$status}%");
             $this->assign("status", $status);
         }
         $where['belong'] = $_SESSION['auth'];
         $shop_id = trim($_POST['shopid']);
         $where['shop_id'] = $shop_id;
         $this->assign("shopid", U('User/index', array('shopid' => $shop_id)));
         parent::showPage("User", "10", $where);
         $user = D('User');
         $id = $user->where($where)->count("id");
         $this->assign("id", $id);
         $shopName = $_SESSION["shop_name"];
         $this->assign("shopName", $shopName);
         $this->display();
     }
 }
 public function searching()
 {
     if (!IS_GET) {
         $this->display();
     } else {
         $str = $_GET['search'];
         $where['company'] = array('like', "%{$str}%");
         $where['address'] = array('like', "%{$str}%");
         $where['boss'] = array('like', "%{$str}%");
         $where['tel'] = array('like', "%{$str}%");
         $where['_logic'] = 'or';
         $this->assign("replace", "<font color='red'>{$str}</font>");
         $this->assign("str", $str);
         parent::showPage("Company", "10", $where);
         $this->display();
     }
 }
 public function searching()
 {
     $model = new Model();
     $sql = "use  " . $_SESSION['dbName'];
     $model->query($sql);
     if (!IS_POST) {
         $this->display();
     } else {
         $bar = trim($_POST['barcode']);
         if ($bar != "") {
             $where['barcode'] = array('like', "%{$bar}%");
             $this->assign("bar", $bar);
         }
         $pro = trim($_POST['product']);
         if ($pro != "") {
             $where['product'] = array('like', "%{$pro}%");
             $this->assign("pro", $pro);
         }
         $let = trim($_POST['letter']);
         if ($let != "") {
             $let = strtoupper($let);
             $where['letter'] = array('like', "%{$let}%");
             $this->assign("let", $let);
         }
         $amount = trim($_POST['outamount']);
         if ($amount != "") {
             $where['num'] = array('like', "%{$amount}%");
             $this->assign("num", $amount);
         }
         $price = trim($_POST['outprice']);
         if ($price != "") {
             $where['presell'] = array('like', "%{$price}%");
             $this->assign("pre", $price);
         }
         $sum = trim($_POST['outsum']);
         if ($sum != "") {
             $where['amount'] = array('like', "%{$sum}%");
             $this->assign("amount", $sum);
         }
         $people = trim($_POST['people']);
         if ($people != "") {
             $where['salesman'] = array('like', "%{$people}%");
             $this->assign("sale", $people);
         }
         $start = trim($_POST['start']);
         $end = trim($_POST['end']);
         if ($end != "") {
             $where['saledate'] = array('between', array($start . " 00:00:00", $end . " 59:59:59"));
             $this->assign("date", $people);
         }
         $shop_id = $_POST['shopid'];
         if ($shop_id == "") {
             $shop_id = $_SESSION["shop_id"];
         }
         if ($shop_id == "") {
             $this->error("非法操作!");
         }
         $shopName = $_SESSION["shop_name"];
         $this->assign("shopName", $shopName);
         $this->assign("shopid", U('Sales/index', array('shopid' => $shop_id)));
         parent::showPage($shop_id . "Sales", "10", $where);
         $out = D($shop_id . 'Sales');
         /*
          * 金额
          */
         $total = $out->where($where)->sum("amount");
         $this->assign("total", $total);
         /*
          * 数量
          */
         $num = $out->where($where)->sum("num");
         $this->assign("sanum", $num);
         /*
          * 单子数
          */
         $id = $out->where($where)->count("id");
         $this->assign("id", $id);
         $this->display();
     }
 }