Example #1
0
 public function import()
 {
     $where = array();
     $shop_ids = getMyShopId();
     $shop_id = get('shop_id');
     if ($shop_id && in_array($shop_id, $shop_ids)) {
         $where[] = "shop_id ='{$shop_id}'";
     } else {
         $where[] = 'shop_id in(' . implode(',', $shop_ids) . ')';
     }
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(sn LIKE '%{$kw}%' OR \n                        user_name LIKE '%{$kw}%' OR \n                        memo LIKE '%{$kw}%')";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $trade_mod = m('Trade');
     $arr = $trade_mod->getList($where, $order, page());
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>单号</td>';
     $data .= '<td>编号</td>';
     $data .= '<td>客户</td>';
     $data .= '<td>联系人</td>';
     $data .= '<td>应收</td>';
     $data .= '<td>扣款</td>';
     $data .= '<td>实收</td>';
     $data .= '<td>优惠</td>';
     $data .= '<td>欠款</td>';
     $data .= '<td>店铺</td>';
     $data .= '<td>操作员</td>';
     $data .= '<td>时间</td>';
     $data .= '<td>备注</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['sn']}</td>";
         $data .= "<td>{$val['customer_sn']}</td>";
         $data .= "<td>{$val['customer_name']}</td>";
         $data .= "<td>{$val['customer_contact']}</td>";
         $data .= "<td>{$val['ysje']}</td>";
         $data .= "<td>{$val['khyc']}</td>";
         $data .= "<td>{$val['ssje']}</td>";
         $data .= "<td>{$val['yhje']}</td>";
         $data .= "<td>{$val['qkje']}</td>";
         $data .= "<td>{$val['shop_name']}</td>";
         $data .= "<td>{$val['user_name']}</td>";
         $data .= '<td>' . date('Y-m-d H:i:s', $val['create_time']) . '</td>';
         $data .= "<td>{$val['memo']}</td>";
         $data .= '</tr>';
     }
     echo outXls($data, '综合统计');
 }
Example #2
0
File: Role.php Project: frycnx/jxc
 public function import()
 {
     $where = array();
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(name LIKE '%{$kw}%')";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $goods_mod = m('Role');
     $data = array();
     $arr = $goods_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>编号</td>';
     $data .= '<td>角色</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['id']}</td>";
         $data .= "<td>{$val['name']}</td>";
         $data .= '</tr>';
     }
     echo outXls($data, '角色');
 }
Example #3
0
 public function import()
 {
     $where = array();
     $name = get('name');
     if (!empty($name)) {
         $where[] = "(name LIKE '%{$name}%' OR pinyin LIKE '%{$name}%')";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $level_mod = m('MemberLevel');
     $arr = $level_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>编号</td>';
     $data .= '<td>级别</td>';
     $data .= '<td>折扣</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['id']}</td>";
         $data .= "<td>{$val['name']}</td>";
         $data .= "<td>{$val['discount']}</td>";
         $data .= '</tr>';
     }
     echo outXls($data, '会员折扣');
 }
Example #4
0
File: User.php Project: frycnx/jxc
 public function import()
 {
     $where = array();
     $shop_id = get('shop_id');
     $shop_ids = getMyShopId();
     if ($shop_id && in_array($shop_id, $shop_ids)) {
         $where[] = "shop_id ='{$shop_id}'";
     } else {
         $where[] = 'shop_id in(' . implode(',', $shop_ids) . ')';
     }
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(username LIKE '%{$kw}%' OR email LIKE '%{$kw}%' OR name LIKE '%{$kw}%' OR phone LIKE '%{$kw}%')";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $user_mod = m('User');
     $data = array();
     $arr = $user_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>店铺</td>';
     $data .= '<td>用户</td>';
     $data .= '<td>姓名</td>';
     $data .= '<td>性别</td>';
     $data .= '<td>邮箱</td>';
     $data .= '<td>电话</td>';
     $data .= '<td>角色</td>';
     $data .= '<td>最后登陆时间</td>';
     $data .= '<td>最后登陆IP</td>';
     $data .= '<td>最后次数</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['shop_name']}</td>";
         $data .= "<td>{$val['username']}</td>";
         $data .= "<td>{$val['name']}</td>";
         $data .= "<td>{$val['sex']}</td>";
         $data .= "<td>{$val['email']}</td>";
         $data .= "<td>{$val['phone']}</td>";
         $data .= "<td>{$val['role_name']}</td>";
         $data .= '<td>' . date('Y-m-d H:i:s', $val['login_time']) . '</td>';
         $data .= "<td>{$val['ip']}</td>";
         $data .= "<td>{$val['count']}</td>";
         $data .= '</tr>';
     }
     echo outXls($data, '用户');
 }
Example #5
0
File: Goods.php Project: frycnx/jxc
 public function import()
 {
     $where = array();
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(sku LIKE '%{$kw}%' OR name LIKE '%{$kw}%' OR pinyin LIKE '%{$kw}%' OR barcode LIKE '%{$kw}%')";
     }
     $cate_id = get('cate_id');
     if (!empty($cate_id)) {
         $where[] = "cate_id = '{$cate_id}'";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $goods_mod = m('Goods');
     $arr = $goods_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>SKU</td>';
     $data .= '<td>商品</td>';
     $data .= '<td>规格</td>';
     $data .= '<td>产地</td>';
     $data .= '<td>单位</td>';
     $data .= '<td>条码</td>';
     $data .= '<td>分类</td>';
     $data .= '<td>备注</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['sku']}</td>";
         $data .= "<td>{$val['name']}</td>";
         $data .= "<td>{$val['spec']}</td>";
         $data .= "<td>{$val['origin']}</td>";
         $data .= "<td>{$val['unit']}</td>";
         $data .= "<td>{$val['barcode']}</td>";
         $data .= "<td>{$val['cate_name']}</td>";
         $data .= "<td>{$val['memo']}</td>";
         $data .= '</tr>';
     }
     echo outXls($data, '商品');
 }
Example #6
0
File: Stock.php Project: frycnx/jxc
 public function export()
 {
     $where = array();
     $shop_id = get('shop_id');
     $shop_ids = getMyShopId();
     if ($shop_id && in_array($shop_id, $shop_ids)) {
         $where[] = "shop_id ='{$shop_id}'";
     } else {
         $where[] = 'shop_id in(' . implode(',', $shop_ids) . ')';
     }
     $cate_id = get('cate_id');
     if (!empty($cate_id)) {
         $where[] = "cate_id={$cate_id}";
     }
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(sku LIKE '%{$kw}%' OR \n                        name LIKE '%{$kw}%' OR \n                        pinyin LIKE '%{$kw}%' OR \n                        barcode LIKE '%{$kw}%')";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $goods_mod = m('Stock');
     $arr = $goods_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>SKU</td>';
     $data .= '<td>商品</td>';
     $data .= '<td>规格</td>';
     $data .= '<td>单位</td>';
     $data .= '<td>分类</td>';
     $data .= '<td>店铺</td>';
     $data .= '<td>库存</td>';
     $data .= '<td>成本价</td>';
     $data .= '<td>成本总额</td>';
     $data .= '<td>销量</td>';
     $data .= '<td>售价</td>';
     $data .= '<td>销售总额</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['sku']}</td>";
         $data .= "<td>{$val['name']}</td>";
         $data .= "<td>{$val['spec']}</td>";
         $data .= "<td>{$val['unit']}</td>";
         $data .= "<td>{$val['cate_name']}</td>";
         $data .= "<td>{$val['shop_name']}</td>";
         $data .= "<td>{$val['stock_num']}</td>";
         $data .= "<td>{$val['price_cost']}</td>";
         $data .= "<td>{$val['total_cost']}</td>";
         $data .= "<td>{$val['sale_num']}</td>";
         $data .= "<td>{$val['price_sell']}</td>";
         $data .= "<td>{$val['total_sell']}</td>";
         $data .= '</tr>';
     }
     echo outXls($data, '库存');
 }
Example #7
0
File: Staff.php Project: frycnx/jxc
 public function import()
 {
     $where = array();
     $shop_id = get('shop_id');
     $shop_ids = getMyShopId();
     if ($shop_id && in_array($shop_id, $shop_ids)) {
         $where[] = "shop_id ='{$shop_id}'";
     } else {
         $where[] = 'shop_id in(' . implode(',', $shop_ids) . ')';
     }
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(name LIKE '%{$kw}%' OR email LIKE '%{$kw}%' OR phone LIKE '%{$kw}%' OR join_time LIKE '%{$kw}%')";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $goods_mod = m('Staff');
     $data = array();
     $arr = $goods_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>店铺</td>';
     $data .= '<td>姓名</td>';
     $data .= '<td>性别</td>';
     $data .= '<td>生日</td>';
     $data .= '<td>邮箱</td>';
     $data .= '<td>电话</td>';
     $data .= '<td>地址</td>';
     $data .= '<td>加入时间</td>';
     $data .= '<td>备注</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['shop_name']}</td>";
         $data .= "<td>{$val['name']}</td>";
         $data .= "<td>{$val['sex']}</td>";
         $data .= "<td>{$val['birth']}</td>";
         $data .= "<td>{$val['email']}</td>";
         $data .= "<td>{$val['phone']}</td>";
         $data .= "<td>{$val['address']}</td>";
         $data .= '<td>' . date('Y-m-d', $val['join_time']) . '</td>';
         $data .= "<td>{$val['memo']}</td>";
         $data .= '</tr>';
     }
     echo outXls($data, '员工');
 }
Example #8
0
 public function import()
 {
     $where = array();
     $shop_id = get('shop_id');
     $shop_ids = getMyShopId();
     if ($shop_id && in_array($shop_id, $shop_ids)) {
         $where[] = "shop_id ='{$shop_id}'";
     } else {
         $where[] = 'shop_id in(' . implode(',', $shop_ids) . ')';
     }
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(member_card like '%{$kw}%' OR \n                        member_name like '%{$kw}%' OR \n                        member_pinyin like '%{$kw}%' OR \n                        memo like '%{$kw}%')";
     }
     $start = get('start');
     if (!empty($start)) {
         $time = strtotime($start);
         $where[] = "create_time > {$time}";
     }
     $end = get('end');
     if (!empty($end)) {
         $time = strtotime($end) + 24 * 3600;
         $where[] = "create_time < {$time}";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $goods_mod = m('MemberRecharge');
     $arr = $goods_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>卡号</td>';
     $data .= '<td>姓名</td>';
     $data .= '<td>级别</td>';
     $data .= '<td>折扣</td>';
     $data .= '<td>店铺</td>';
     $data .= '<td>当前消费</td>';
     $data .= '<td>充值金额</td>';
     $data .= '<td>实充金额</td>';
     $data .= '<td>卡内金额</td>';
     $data .= '<td>操作员</td>';
     $data .= '<td>备注</td>';
     $data .= '<td>时间</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['member_card']}</td>";
         $data .= "<td>{$val['member_name']}</td>";
         $data .= "<td>{$val['level_name']}</td>";
         $data .= "<td>{$val['level_discount']}</td>";
         $data .= "<td>{$val['shop_name']}</td>";
         $data .= "<td>{$val['consume']}</td>";
         $data .= "<td>{$val['real_money']}</td>";
         $data .= "<td>{$val['add_money']}</td>";
         $data .= "<td>{$val['current_money']}</td>";
         $data .= "<td>{$val['user_name']}</td>";
         $data .= "<td>{$val['memo']}</td>";
         $data .= '<td>' . date('Y-m-d H:i:s', $val['create_time']) . '</td>';
         $data .= '</tr>';
     }
     echo outXls($data, '会员充值');
 }
Example #9
0
 public function import()
 {
     $where = array();
     $shop_id = get('shop_id');
     $shop_ids = getMyShopId();
     if ($shop_id && in_array($shop_id, $shop_ids)) {
         $where[] = "shop_id ='{$shop_id}'";
     } else {
         $where[] = 'shop_id in(' . implode(',', $shop_ids) . ')';
     }
     $level_id = get('level_id');
     if (!empty($level_id)) {
         $where[] = " level_id ='{$level_id}'";
     }
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(card like '%{$kw}%' OR \n\t\t\t\t\t\tname like '%{$kw}%' OR \n\t\t\t\t\t\tpinyin like '%{$kw}%' OR \n\t\t\t\t\t\tbirth like '%{$kw}%' OR \n\t\t\t\t\t\tphone like '%{$kw}%' OR \n\t\t\t\t\t\taddress like '%{$kw}%' OR \n\t\t\t\t\t\tmemo like '%{$kw}%')";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $member_mod = m('Member');
     $arr = $member_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>卡号</td>';
     $data .= '<td>姓名</td>';
     $data .= '<td>性别</td>';
     $data .= '<td>生日</td>';
     $data .= '<td>电话</td>';
     $data .= '<td>地址</td>';
     $data .= '<td>预存</td>';
     $data .= '<td>消费</td>';
     $data .= '<td>积分</td>';
     $data .= '<td>级别</td>';
     $data .= '<td>折扣</td>';
     $data .= '<td>店铺</td>';
     $data .= '<td>备注</td>';
     $data .= '<td>创建时间</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['card']}</td>";
         $data .= "<td>{$val['name']}</td>";
         $data .= "<td>{$val['sex']}</td>";
         $data .= "<td>{$val['birth']}</td>";
         $data .= "<td>{$val['phone']}</td>";
         $data .= "<td>{$val['address']}</td>";
         $data .= "<td>{$val['money']}</td>";
         $data .= "<td>{$val['consume']}</td>";
         $data .= "<td>{$val['point']}</td>";
         $data .= "<td>{$val['level_name']}</td>";
         $data .= "<td>{$val['level_discount']}</td>";
         $data .= "<td>{$val['shop_name']}</td>";
         $data .= "<td>{$val['memo']}</td>";
         $data .= '<td>' . date('Y-m-d H:i:s', $val['create_time']) . '</td>';
         $data .= '</tr>';
     }
     echo outXls($data, '会员');
 }
Example #10
0
 public function import()
 {
     $where = array();
     $shop_id = get('shop_id');
     $shop_ids = getMyShopId();
     if ($shop_id && in_array($shop_id, $shop_ids)) {
         $where[] = "shop_id ='{$shop_id}'";
     } else {
         $where[] = 'shop_id in(' . implode(',', $shop_ids) . ')';
     }
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(customer_sn like '%{$kw}%' OR \n\t\t\t\t\t\tcustomer_name like '%{$kw}%' OR \n\t\t\t\t\t\tcustomer_pinyin like '%{$kw}%' OR \n\t\t\t\t\t\tcustomer_contact like '%{$kw}%' OR \n\t\t\t\t\t\tcustomer_phone like '%{$kw}%')";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $csut_mod = m('CustomerPay');
     $arr = $csut_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>店铺</td>';
     $data .= '<td>客户</td>';
     $data .= '<td>联系人</td>';
     $data .= '<td>电话</td>';
     $data .= '<td>当前欠款</td>';
     $data .= '<td>当前优惠</td>';
     $data .= '<td>当前消费</td>';
     $data .= '<td>收款</td>';
     $data .= '<td>优惠</td>';
     $data .= '<td>操作员</td>';
     $data .= '<td>备注</td>';
     $data .= '<td>时间</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['shop_name']}</td>";
         $data .= "<td>{$val['customer_name']}</td>";
         $data .= "<td>{$val['customer_contact']}</td>";
         $data .= "<td>{$val['customer_phone']}</td>";
         $data .= "<td>{$val['customer_overdraft']}</td>";
         $data .= "<td>{$val['customer_offer']}</td>";
         $data .= "<td>{$val['customer_consume']}</td>";
         $data .= "<td>{$val['pay']}</td>";
         $data .= "<td>{$val['offer']}</td>";
         $data .= "<td>{$val['user_name']}</td>";
         $data .= "<td>{$val['memo']}</td>";
         $data .= '<td>' . date('Y-m-d H:i:s', $val['create_time']) . '</td>';
         $data .= '</tr>';
     }
     echo outXls($data, '客户收款');
 }
Example #11
0
 public function import()
 {
     $where = array();
     $shop_id = get('shop_id');
     $shop_ids = getMyShopId();
     if ($shop_id && in_array($shop_id, $shop_ids)) {
         $where[] = "shop_id ='{$shop_id}'";
     } else {
         $where[] = 'shop_id in(' . implode(',', $shop_ids) . ')';
     }
     $cate_id = get('cate_id');
     if (!empty($cate_id)) {
         $where[] = "cate_id='{$cate_id}'";
     }
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(goods_id LIKE '%{$kw}%' OR goods_name LIKE '%{$kw}%' OR pinyin LIKE '%{$kw}%' OR barcode LIKE '%{$kw}%')";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $goods_mod = m('GoodsSale');
     $arr = $goods_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>SKU</td>';
     $data .= '<td>商品</td>';
     $data .= '<td>规格</td>';
     $data .= '<td>单位</td>';
     $data .= '<td>条码</td>';
     $data .= '<td>分类</td>';
     $data .= '<td>店铺</td>';
     $data .= '<td>售价</td>';
     $data .= '<td>特价</td>';
     $data .= '<td>会员价</td>';
     $data .= '<td>期限</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['goods_sku']}</td>";
         $data .= "<td>{$val['goods_name']}</td>";
         $data .= "<td>{$val['goods_spec']}</td>";
         $data .= "<td>{$val['goods_unit']}</td>";
         $data .= "<td>{$val['goods_barcode']}</td>";
         $data .= "<td>{$val['cate_name']}</td>";
         $data .= "<td>{$val['shop_name']}</td>";
         $data .= "<td>{$val['price_sell']}</td>";
         $data .= "<td>{$val['price_sale']}</td>";
         $data .= "<td>{$val['price_member']}</td>";
         if ($val['sale_time_type'] == 'a') {
             $data .= '<td>无限期</td>';
         } else {
             if ($val['sale_time_type'] == 't') {
                 $ar = explode(',', $val['sale_time']);
                 $data .= '<td>';
                 if (isset($ar[0])) {
                     $data .= date('Y-m-d', $ar[0]);
                 } else {
                     $data .= '-';
                 }
                 $data .= '至';
                 if (isset($ar[1])) {
                     $data .= date('Y-m-d', $ar[1]);
                 } else {
                     $data .= '-';
                 }
                 $data .= '</td>';
             } else {
                 if ($val['sale_time_type'] == 'w') {
                     $ar = explode(',', $val['sale_time']);
                     $st = '';
                     if (in_array('1', $ar)) {
                         $st .= ',周一';
                     }
                     if (in_array('2', $ar)) {
                         $st .= ',周二';
                     }
                     if (in_array('3', $ar)) {
                         $st .= ',周三';
                     }
                     if (in_array('4', $ar)) {
                         $st .= ',周四';
                     }
                     if (in_array('5', $ar)) {
                         $st .= ',周五';
                     }
                     if (in_array('6', $ar)) {
                         $st .= ',周六';
                     }
                     if (in_array('0', $ar)) {
                         $st .= ',周日';
                     }
                     $st = substr($st, 1);
                     $data .= "<td>{$st}</td>";
                 }
             }
         }
         $data .= '</tr>';
     }
     echo outXls($data, '特价');
 }
Example #12
0
 public function import()
 {
     $where = array();
     $shop_id = get('shop_id');
     $shop_ids = getMyShopId();
     if ($shop_id && in_array($shop_id, $shop_ids)) {
         $where[] = "shop_id ='{$shop_id}'";
     } else {
         $where[] = 'shop_id in(' . implode(',', $shop_ids) . ')';
     }
     $kw = get('kw');
     if (!empty($kw)) {
         $where[] = "(sn like '%{$kw}%' OR \n\t\t\t\t\t\tname like '%{$kw}%' OR \n\t\t\t\t\t\tpinyin like '%{$kw}%' OR \n\t\t\t\t\t\tcontact like '%{$kw}%' OR \n\t\t\t\t\t\tphone like '%{$kw}%' OR \n\t\t\t\t\t\tmemo like '%{$kw}%')";
     }
     $order = array();
     $sort = get('sort');
     if (is_array($sort)) {
         foreach ($sort as $key => $val) {
             $order[] = $key . ' ' . $val;
         }
     }
     $cus_mod = m('Customer');
     $data = array();
     $arr = $cus_mod->getList($where, $order);
     $data = '';
     $data .= '<table cellspacing="0" style="width:100%;border-collapse:collapse;">';
     $data .= '<tr>';
     $data .= '<td>店铺</td>';
     $data .= '<td>客户</td>';
     $data .= '<td>联系人</td>';
     $data .= '<td>电话</td>';
     $data .= '<td>地址</td>';
     $data .= '<td>预存</td>';
     $data .= '<td>欠款</td>';
     $data .= '<td>优惠</td>';
     $data .= '<td>消费</td>';
     $data .= '<td>备注</td>';
     $data .= '</tr>';
     foreach ($arr as $val) {
         $data .= '<tr>';
         $data .= "<td>{$val['shop_name']}</td>";
         $data .= "<td>{$val['name']}</td>";
         $data .= "<td>{$val['contact']}</td>";
         $data .= "<td>{$val['phone']}</td>";
         $data .= "<td>{$val['address']}</td>";
         $data .= "<td>{$val['money']}</td>";
         $data .= "<td>{$val['overdraft']}</td>";
         $data .= "<td>{$val['offer']}</td>";
         $data .= "<td>{$val['consume']}</td>";
         $data .= "<td>{$val['memo']}</td>";
         $data .= '</tr>';
     }
     echo outXls($data, '客户');
 }