function list_action() {
     $this->view->page=front::get('page') ?front::get('page') : 1;
     $this->pagesize=config::get('list_pagesize');
     $limit=(($this->view->page -1) * $this->pagesize).','.$this->pagesize;
     $area=new area();
     $where='1';
     if (front::get('province_id')) $where.=' and id='.front::get('province_id');
     if (front::get('city_id')) $where.=' and id='.front::get('city_id');
     if (front::get('section_id')) $where.=' and id='.front::get('section_id');
     if (front::get('id')) $where.=' and id='.front::get('id');
     $this->view->area=$area->getrow($where);
     $archive=new archive();
     $where='1';
     if (front::get('province_id')) $where.=' and province_id='.front::get('province_id');
     if (front::get('city_id')) $where.=' and city_id='.front::get('city_id');
     if (front::get('section_id')) $where.=' and section_id='.front::get('section_id');
     if (front::get('id')) $where.=' and section_id='.front::get('id').' or city_id='.front::get('id').' or province_id='.front::get('id');
     $archives=$archive->getrows($where,$limit,'listorder,aid desc');
     foreach ($archives as $order=>$arc) {
         $archives[$order]['url']=archive::url($arc);
         $archives[$order]['catname']=category::name($arc['catid']);
         $archives[$order]['caturl']=category::url($arc['catid']);
         $archives[$order]['adddate']=sdate($arc['adddate']);
         $archives[$order]['stitle']=strip_tags($arc['title']);
     }
     $this->view->pages=true;
     if(front::get('id')!='') {
         $this->view->areaid=front::get('id');
     }elseif(front::get('province_id')!='') {
         $this->view->areaid=front::get('province_id');
     }elseif(front::get('city_id')!='') {
         $this->view->areaid=front::get('city_id');
     }elseif(front::get('section_id')!='') {
         $this->view->areaid=front::get('section_id');
     }
     $this->view->archive['title'] = area::name($this->view->areaid);
     $this->view->archives=$archives;
     $this->view->record_count=$archive->rec_count($where);
     front::$record_count=$this->view->record_count;
     
     if (front::get('t') == 'wap') {
     	$this->out('wap/area_list.html');
     	return;
     }
     
     $this->render();
 }
Exemple #2
0
 /**
  * @brief查看订单
  */
 public function order_show()
 {
     //获得post传来的值
     $order_id = IFilter::act(IReq::get('id'), 'int');
     $data = array();
     if ($order_id) {
         $order_show = new Order_Class();
         $data = $order_show->getOrderShow($order_id);
         if ($data) {
             //获得折扣前的价格
             $rule = new ProRule($data['real_amount']);
             $this->result = $rule->getInfo();
             //获取地区
             $data['area_addr'] = join(' ', area::name($data['province'], $data['city'], $data['area']));
             $this->setRenderData($data);
             $this->redirect('order_show', false);
         }
     }
     if (!$data) {
         $this->redirect('order_list');
     }
 }
Exemple #3
0
 public function getTakeselfList()
 {
     $id = IFilter::act(IReq::get('id'), 'int');
     $type = IFilter::act(IReq::get('type'));
     $takeselfObj = new IQuery('takeself');
     switch ($type) {
         case "province":
             $where = "province = " . $id;
             $takeselfObj->group = 'city';
             break;
         case "city":
             $where = "city = " . $id;
             $takeselfObj->group = 'area';
             break;
         case "area":
             $where = "area = " . $id;
             break;
     }
     $takeselfObj->where = $where;
     $takeselfList = $takeselfObj->find();
     foreach ($takeselfList as $key => $val) {
         $temp = area::name($val['province'], $val['city'], $val['area']);
         $takeselfList[$key]['province_str'] = $temp[$val['province']];
         $takeselfList[$key]['city_str'] = $temp[$val['city']];
         $takeselfList[$key]['area_str'] = $temp[$val['area']];
     }
     die(JSON::encode($takeselfList));
 }
Exemple #4
0
 public function conver($expressConfig, $order_id, $seller_id = 0)
 {
     $resultArray = array();
     //函数返回数据
     $wholeData = array();
     //实际的数据
     //获取订单信息
     $id = intval($order_id);
     $orderObj = new IModel('order');
     $orderRow = $orderObj->getObj('id = ' . $id . ' and seller_id = ' . $seller_id);
     if (empty($orderRow)) {
         return null;
     }
     //获取发货地址信息
     $shipInfoObj = new IModel('merch_ship_info');
     $shipList = $shipInfoObj->query('is_del = 1 and seller_id = ' . $seller_id, '*', 'is_default', 'desc', '1');
     if (empty($shipList)) {
         $shipRow = array('ship_user_name' => '', 'address' => '', 'telphone' => '', 'mobile' => '', 'postcode' => '', 'province' => '', 'city' => '', 'area' => '');
     } else {
         $shipRow = $shipList[0];
     }
     //获取订单总重量和总数量
     $orderGoodsObj = new IModel('order_goods');
     $orderTotal = $orderGoodsObj->getObj('order_id = ' . $id, 'SUM(goods_nums) as num_total,SUM(goods_weight * goods_nums) as weight_total');
     /*拼接实际数据 $wholeData*/
     //查询area地域数据
     $areaData = area::name($orderRow['province'], $orderRow['city'], $orderRow['area'], $shipRow['province'], $shipRow['city'], $shipRow['area']);
     //获取site_config配置信息
     $site_config = new Config('site_config');
     $site_config = $site_config->getInfo();
     $wholeData['ship_name'] = $orderRow['accept_name'];
     $wholeData['ship_area_0'] = isset($areaData[$orderRow['province']]) ? $areaData[$orderRow['province']] : '';
     $wholeData['ship_area_1'] = isset($areaData[$orderRow['city']]) ? $areaData[$orderRow['city']] : '';
     $wholeData['ship_area_2'] = isset($areaData[$orderRow['area']]) ? $areaData[$orderRow['area']] : '';
     $wholeData['ship_addr'] = $orderRow['address'];
     $wholeData['ship_tel'] = $orderRow['telphone'];
     $wholeData['ship_mobile'] = $orderRow['mobile'];
     $wholeData['ship_zip'] = $orderRow['postcode'];
     $wholeData['ship_detail_addr'] = $wholeData['ship_area_0'] . $wholeData['ship_area_1'] . $wholeData['ship_area_2'] . $orderRow['address'];
     $wholeData['dly_name'] = $shipRow['ship_user_name'];
     $wholeData['dly_area_0'] = isset($areaData[$shipRow['province']]) ? $areaData[$shipRow['province']] : '';
     $wholeData['dly_area_1'] = isset($areaData[$shipRow['city']]) ? $areaData[$shipRow['city']] : '';
     $wholeData['dly_area_2'] = isset($areaData[$shipRow['area']]) ? $areaData[$shipRow['area']] : '';
     $wholeData['dly_address'] = $shipRow['address'];
     $wholeData['dly_tel'] = $shipRow['telphone'];
     $wholeData['dly_mobile'] = $shipRow['mobile'];
     $wholeData['dly_zip'] = $shipRow['postcode'];
     $wholeData['date_y'] = date('Y');
     $wholeData['date_m'] = date('m');
     $wholeData['date_d'] = date('d');
     $wholeData['order_id'] = $orderRow['order_no'];
     $wholeData['order_price'] = $orderRow['order_amount'];
     $wholeData['order_weight'] = isset($orderTotal['weight_total']) ? $orderTotal['weight_total'] : '';
     $wholeData['order_count'] = isset($orderTotal['num_total']) ? $orderTotal['num_total'] : '';
     $wholeData['order_memo'] = $orderRow['note'];
     $wholeData['ship_time'] = $orderRow['accept_time'];
     $wholeData['shop_name'] = isset($site_config['name']) ? $site_config['name'] : '';
     $wholeData['tick'] = '√';
     //进行数据替换
     foreach ($expressConfig as $key => $val) {
         $item_tmp = JSON::decode($val);
         $item_tmp['typeText'] = isset($wholeData[$item_tmp['typeId']]) ? $wholeData[$item_tmp['typeId']] : '';
         $resultArray[] = JSON::encode($item_tmp);
     }
     return $resultArray;
 }
Exemple #5
0
 function address_add()
 {
     $accept_name = IFilter::act(IReq::get('accept_name'));
     $province = IFilter::act(IReq::get('province'), 'int');
     $city = IFilter::act(IReq::get('city'), 'int');
     $area = IFilter::act(IReq::get('area'), 'int');
     $address = IFilter::act(IReq::get('address'));
     $zip = IFilter::act(IReq::get('zip'));
     $telphone = IFilter::act(IReq::get('telphone'));
     $mobile = IFilter::act(IReq::get('mobile'));
     $user_id = $this->user['user_id'];
     if (!$user_id) {
         die(JSON::encode(array('data' => null)));
     }
     //整合的数据,检查数据库中是否存在此收货地址
     $sqlData = array('user_id' => $user_id, 'accept_name' => $accept_name, 'zip' => $zip, 'telphone' => $telphone, 'province' => $province, 'city' => $city, 'area' => $area, 'address' => $address, 'mobile' => $mobile);
     $sqlArray = array();
     foreach ($sqlData as $key => $val) {
         $sqlArray[] = $key . '="' . $val . '"';
     }
     $model = new IModel('address');
     $addressRow = $model->getObj(join(' and ', $sqlArray));
     if ($addressRow) {
         $result = array('data' => null);
     } else {
         //获取地区text
         $areaList = area::name($province, $city, $area);
         //执行insert
         $model->setData($sqlData);
         $id = $model->add();
         $sqlData['id'] = $id;
         $sqlData['province_val'] = $areaList[$province];
         $sqlData['city_val'] = $areaList[$city];
         $sqlData['area_val'] = $areaList[$area];
         $result = array('data' => $sqlData);
     }
     die(JSON::encode($result));
 }
Exemple #6
0
			<?php 
if (isset($seller)) {
    ?>
			<li>店主:<a class="orange" href="<?php 
    echo IUrl::creatUrl("/site/home/id/" . $seller_id . "");
    ?>
"><?php 
    echo isset($seller['true_name']) ? $seller['true_name'] : "";
    ?>
</a></li>
			<li>联系电话:<?php 
    echo isset($seller['phone']) ? $seller['phone'] : "";
    ?>
</li>
			<li>所在地:<?php 
    echo join(' ', area::name($seller['province'], $seller['city'], $seller['area']));
    ?>
</li>
			<li><strong> 该商品为平台店主销售并发货的商品,由店主收款并提供相应的售后服务。请您放心购买!</strong></li>
			<?php 
}
?>
			<!--商家信息 结束-->
		</ul>

		<!--配送方式的模板-->
		<script type='text/html' id='deliveInfoTemplate'>
			<%if(if_delivery == 0){%>
			<%=name%>:<b class="orange"><%=price%></b>(<%=description%>)
			&nbsp;&nbsp;
			<%}else{%>
Exemple #7
0
 /**
  * @brief 我的地址
  */
 public function address()
 {
     //取得自己的地址
     $query = new IQuery('address');
     $query->where = 'user_id = ' . $this->user['user_id'];
     $address = $query->find();
     $areas = array();
     if ($address) {
         foreach ($address as $ad) {
             $temp = area::name($ad['province'], $ad['city'], $ad['area'], $ad['school']);
             $areas[$ad['province']] = $temp[$ad['province']];
             $areas[$ad['city']] = $temp[$ad['city']];
             $areas[$ad['area']] = $temp[$ad['area']];
             $areas[$ad['school']] = $temp[$ad['school']];
         }
     }
     $this->areas = $areas;
     $this->address = $address;
     $this->redirect('address');
 }
 public function merge_template()
 {
     $this->layout = 'print';
     $order_id = IFilter::act(IReq::get('id'), 'int');
     $seller_id = IFilter::act(IReq::get('seller_id'), 'int');
     $tb_order = new IModel('order');
     $data = $tb_order->getObj('id=' . $order_id);
     if ($seller_id) {
         $sellerObj = new IModel('seller');
         $config_info = $sellerObj->getObj('id = ' . $seller_id);
         $data['set']['name'] = isset($config_info['true_name']) ? $config_info['true_name'] : '';
         $data['set']['phone'] = isset($config_info['phone']) ? $config_info['phone'] : '';
         $data['set']['email'] = isset($config_info['email']) ? $config_info['email'] : '';
         $data['set']['url'] = isset($config_info['home_url']) ? $config_info['home_url'] : '';
     } else {
         $config = new Config("site_config");
         $config_info = $config->getInfo();
         $data['set']['name'] = isset($config_info['name']) ? $config_info['name'] : '';
         $data['set']['phone'] = isset($config_info['phone']) ? $config_info['phone'] : '';
         $data['set']['email'] = isset($config_info['email']) ? $config_info['email'] : '';
         $data['set']['url'] = isset($config_info['url']) ? $config_info['url'] : '';
     }
     //获取地区
     $data['address'] = join('&nbsp;', area::name($data['province'], $data['city'], $data['area'])) . "&nbsp;" . $data['address'];
     $data['seller_id'] = $seller_id;
     $this->setRenderData($data);
     $this->redirect("merge_template");
 }
Exemple #9
0
 /**
  * 获取订单基本信息
  * @param $orderIdString string 订单ID序列
  * @param $seller_id int 商家ID
  */
 public function getOrderInfo($orderIdString, $seller_id = 0)
 {
     $orderObj = new IModel('order');
     $areaIdArray = array();
     $orderList = $orderObj->query('id in (' . $orderIdString . ') and seller_id = ' . $seller_id);
     if (!$orderList) {
         IError::show(403, "无查阅订单权限");
     }
     foreach ($orderList as $key => $val) {
         $temp = area::name($val['province'], $val['city'], $val['area']);
         $orderList[$key]['province_str'] = $temp[$val['province']];
         $orderList[$key]['city_str'] = $temp[$val['city']];
         $orderList[$key]['area_str'] = $temp[$val['area']];
     }
     return $orderList;
 }
Exemple #10
0
 public function order_report()
 {
     //搜索条件
     $search = IFilter::act(IReq::get('search'), 'strict');
     //条件筛选处理
     list($join, $where) = order_class::getSearchCondition($search);
     //拼接sql
     $orderHandle = new IQuery('order as o');
     $orderHandle->order = "o.id desc";
     $orderHandle->fields = "o.*,d.name as distribute_name,u.username,p.name as payment_name";
     $orderHandle->join = $join;
     $orderHandle->where = $where;
     $orderList = $orderHandle->find();
     $strTable = '<table width="500" border="1">';
     $strTable .= '<tr>';
     $strTable .= '<td style="text-align:center;font-size:12px;width:120px;">订单编号</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="100">日期</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">收货人</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">收货地址</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">电话</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">订单金额</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">实际支付</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">支付方式</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">支付状态</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">发货状态</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">商品信息</td>';
     $strTable .= '</tr>';
     foreach ($orderList as $k => $val) {
         $strTable .= '<tr>';
         $strTable .= '<td style="text-align:center;font-size:12px;">&nbsp;' . $val['order_no'] . '</td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['create_time'] . ' </td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['accept_name'] . ' </td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">' . join('&nbsp;', area::name($val['province'], $val['city'], $val['area'])) . $val['address'] . ' &nbsp; </td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">&nbsp;' . $val['telphone'] . '&nbsp;' . $val['mobile'] . ' </td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['payable_amount'] . ' </td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['real_amount'] . ' </td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['payment_name'] . ' </td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">' . Order_Class::getOrderPayStatusText($val) . ' </td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">' . Order_Class::getOrderDistributionStatusText($val) . ' </td>';
         $orderGoods = Order_class::getOrderGoods($val['id']);
         $strGoods = "";
         foreach ($orderGoods as $good) {
             $strGoods .= "商品编号:" . $good->goodsno . " 商品名称:" . $good->name;
             if ($good->value != '') {
                 $strGoods .= " 规格:" . $good->value;
             }
             $strGoods .= "<br />";
         }
         unset($orderGoods);
         $strTable .= '<td style="text-align:left;font-size:12px;">' . $strGoods . ' </td>';
         $strTable .= '</tr>';
     }
     $strTable .= '</table>';
     unset($orderList);
     $reportObj = new report();
     $reportObj->setFileName('order');
     $reportObj->toDownload($strTable);
     exit;
 }
Exemple #11
0
 /**
  * 获取订单基本信息
  * @param $orderIdString string 订单ID序列
  */
 public function getOrderInfo($orderIdString)
 {
     $orderObj = new IModel('order');
     $areaIdArray = array();
     $orderList = $orderObj->query('id in (' . $orderIdString . ')');
     foreach ($orderList as $key => $val) {
         $temp = area::name($val['province'], $val['city'], $val['area']);
         $orderList[$key]['province_str'] = $temp[$val['province']];
         $orderList[$key]['city_str'] = $temp[$val['city']];
         $orderList[$key]['area_str'] = $temp[$val['area']];
     }
     return $orderList;
 }
Exemple #12
0
 /**
  * @brief查看订单
  */
 public function order_show()
 {
     //获得post传来的值
     $order_id = IFilter::act(IReq::get('id'), 'int');
     $data = array();
     if ($order_id) {
         $order_show = new Order_Class();
         $data = $order_show->getOrderShow($order_id, 0, $this->seller['seller_id']);
         if ($data) {
             //获取地区
             $data['area_addr'] = join('&nbsp;', area::name($data['province'], $data['city'], $data['area']));
             $this->setRenderData($data);
             $this->redirect('order_show', false);
         }
     }
     if (!$data) {
         $this->redirect('order_list');
     }
 }