Exemplo n.º 1
0
 /**
  * 模板管理
  */
 public function waybill_manageOp()
 {
     $model_store_extend = Model('store_extend');
     $model_express = Model('express');
     $model_store_waybill = Model('store_waybill');
     $store_extend_info = $model_store_extend->getStoreExtendInfo(array('store_id' => $_SESSION['store_id']), 'express');
     $store_express = $store_extend_info['express'];
     $express_list = $model_express->getExpressListByID($store_express);
     $store_waybill_list = $model_store_waybill->getStoreWaybillListWithWaybillInfo($_SESSION['store_id'], $store_express);
     $store_waybill_list = uk86_array_under_reset($store_waybill_list, 'express_id');
     if (!empty($express_list)) {
         foreach ($express_list as $key => $value) {
             if (!empty($store_waybill_list[$value['id']])) {
                 $express_list[$key]['waybill_name'] = $store_waybill_list[$value['id']]['waybill_name'];
                 $express_list[$key]['store_waybill_id'] = $store_waybill_list[$value['id']]['store_waybill_id'];
                 $express_list[$key]['is_default_text'] = $store_waybill_list[$value['id']]['is_default'] ? '是' : '否';
                 $express_list[$key]['waybill_image_url'] = uk86_getWaybillImageUrl($store_waybill_list[$value['id']]['waybill_image']);
                 $express_list[$key]['waybill_width'] = $store_waybill_list[$value['id']]['waybill_width'];
                 $express_list[$key]['waybill_height'] = $store_waybill_list[$value['id']]['waybill_height'];
                 $express_list[$key]['bind'] = true;
             } else {
                 $express_list[$key]['waybill_name'] = '未绑定';
                 $express_list[$key]['bind'] = false;
             }
         }
     }
     Tpl::output('express_list', $express_list);
     $this->profile_menu('waybill_manage');
     Tpl::showpage('store_waybill.manage');
 }
Exemplo n.º 2
0
 /**
  * 读取单条记录
  * @param array $condition
  *
  */
 public function getWaybillInfo($condition)
 {
     $waybill_info = $this->where($condition)->find();
     if ($waybill_info) {
         $waybill_info['waybill_image_url'] = uk86_getWaybillImageUrl($waybill_info['waybill_image']);
         $waybill_info['waybill_pixel_width'] = $waybill_info['waybill_width'] * self::WAYBILL_PIXEL_CONSTANT;
         $waybill_info['waybill_pixel_height'] = $waybill_info['waybill_height'] * self::WAYBILL_PIXEL_CONSTANT;
         $waybill_info['waybill_pixel_top'] = $waybill_info['waybill_top'] * self::WAYBILL_PIXEL_CONSTANT;
         $waybill_info['waybill_pixel_left'] = $waybill_info['waybill_left'] * self::WAYBILL_PIXEL_CONSTANT;
         if (!empty($waybill_info['waybill_data'])) {
             $waybill_info['waybill_data'] = unserialize($waybill_info['waybill_data']);
             //整理打印模板
             $waybill_item = $this->getWaybillItemList();
             foreach ($waybill_info['waybill_data'] as $key => $value) {
                 $waybill_info['waybill_data'][$key]['content'] = $waybill_item[$key]['item_text'];
             }
         }
     }
     return $waybill_info;
 }