Exemple #1
0
 /**
  * 加载地区子节点
  */
 public function getChildNode()
 {
     $id = input::get('regionId');
     $data = area::getAreaIdPath()[$id];
     foreach ($data as $key) {
         $childData[$key] = area::areaKvdata()[$key];
         if (area::getAreaIdPath()[$key]) {
             $childData[$key]['is_child'] = true;
         }
     }
     $pagedata['step'] = input::get('level');
     $pagedata['level'] = input::get('level') + 1;
     $pagedata['childData'] = $childData;
     return view::make('syslogistics/delivery/area_sub_treeList.html', $pagedata);
 }
Exemple #2
0
 public function modifier_areaNameById($areaIds)
 {
     $areaIdArr = explode(',', $areaIds);
     $areaKvdata = area::areaKvdata();
     foreach ($areaIdArr as $id) {
         if ($areaKvdata[$id]['parentId'] == 1 || !area::getAreaNameById($areaKvdata[$id]['parentId'])) {
             $areaNameArr[] = area::getAreaNameById($id);
         } else {
             $area[area::getAreaNameById($areaKvdata[$id]['parentId'])][] = area::getAreaNameById($id);
         }
     }
     foreach ($area as $parent => $list) {
         $areaNameArr[] = $parent . '<em class="text-muted">(' . implode(',', $list) . ')</em>';
     }
     return implode(',', $areaNameArr);
 }
Exemple #3
0
 public function edit()
 {
     $pagedata['areaData'] = area::areaKvdata();
     $pagedata['areaPath'] = area::getAreaIdPath();
     if (input::get('id')) {
         $data = app::get('syslogistics')->rpcCall('logistics.ziti.get', ['id' => input::get('id')]);
         foreach ((array) explode(',', $data['area_id']) as $areaId) {
             if ($parentId) {
                 $areaData[$areaId] = $pagedata['areaPath'][$parentId];
                 $parentId = $areaId;
             } else {
                 $areaData[$areaId] = area::getAreaDataLv1();
                 $parentId = $areaId;
             }
         }
         $pagedata['selectArea'] = $areaData;
         $data['area'] = $data['area'] . ":" . $data['area_id'];
         $pagedata['data'] = $data;
     } else {
         $pagedata['areaLv1'] = area::getAreaDataLv1();
     }
     return view::make('syslogistics/ziti/edit.html', $pagedata);
 }