Example #1
0
 /**
  * array(
  * 		'sys_id' => 1,
  * 		'gu_id' => 'c08d6299-14fe-8dcd-c908-461f78ba16dd',
  * )
  *
  * @return array
  */
 public function getNewIdGroup()
 {
     $aNewGuId = Watt_Util_Utils::getGuId();
     $rev = array();
     if ($aNewGuId) {
         $sql = " insert into {$this->_managerName}(gu_id) values ('" . $aNewGuId . "')";
         if ($this->_db->execute($sql)) {
             $theNewSysId = $this->_db->Insert_ID();
             $rev['sys_id'] = $theNewSysId;
             $rev['gu_id'] = $aNewGuId;
         }
     }
     return $rev;
 }
Example #2
0
 public static function ExportToXls($arr, $file_name = null, $is_fullname = false, $expand_name = 'xls', $path = null, $is_model = false, $is_output = false)
 {
     set_time_limit(36000000);
     if (!$expand_name || $expand_name == '') {
         $expand_name = 'xls';
     }
     if (strtolower($expand_name) != 'xls' && strtolower($expand_name) != 'pdf') {
         $expand_name = 'xls';
     }
     if ($is_fullname && $file_name && $file_name != '') {
     } else {
         if (!$file_name) {
             $file_name = 'Export' . date('-ymd-His', time());
         } else {
             $file_name = $file_name . date('-ymd-His', time());
         }
         //防止重名
         $guid = Watt_Util_Utils::getGuId();
         $file_name .= '-' . substr($guid, 0, 8);
     }
     if ($path) {
         if (!$is_model) {
             $new_path = $path . $file_name . "." . $expand_name;
         }
     } else {
         $new_path = Watt_Config::getUploadPath() . $file_name . "." . $expand_name;
     }
     //输出的路径
     $out_path = Watt_Config::getSiteRoot() . "upload/" . $file_name . "." . $expand_name;
     if ($is_model) {
         self::getXlsByModel($arr, $path, $new_path, $file_name, $expand_name, $is_output);
     } else {
         self::getXlsPathByArr($arr, $new_path, $file_name, $expand_name, $is_output);
     }
     return $out_path;
 }