当前位置: 首页>>代码示例>>PHP>>正文


PHP APP::import方法代码示例

本文整理汇总了PHP中APP::import方法的典型用法代码示例。如果您正苦于以下问题:PHP APP::import方法的具体用法?PHP APP::import怎么用?PHP APP::import使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在APP的用法示例。


在下文中一共展示了APP::import方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: find_customer

 public function find_customer($id = null)
 {
    APP::import('Model','Customer');
     $this->Customer   =   new Customer();
     $cus = $this->Customer->find('first',array('conditions'=>array('Customer.id'=>$id)));
     return $cus['Customer']['customername'].'('.$cus['Customer']['tag_name'].')';
 }
开发者ID:ArunPrasaath,项目名称:bs,代码行数:7,代码来源:DeliveryHelper.php

示例2: rankFolder

 /**
  * add shop to folder
  * 
  */
 public function rankFolder($conditions, $user_id)
 {
     APP::import("Model", array("User"));
     $this->User = new User();
     $user = $this->User->findById($user_id);
     $folder = $this->find('list', array('conditions' => $conditions, "group by" => "Folder.id", "order" => "FolderUser.modified DESC", 'fields' => array('FolderUser.id', 'FolderUser.id')));
     $rank_folder = array();
     if (!empty($folder)) {
         if (empty($user["User"]["rank_folder"])) {
             $rank_folder = $folder;
         } else {
             $list = explode(",", $user["User"]["rank_folder"]);
             $listRank = array();
             foreach ($list as $val) {
                 if (!empty($folder[$val])) {
                     $listRank[] = $val;
                 }
             }
             $rank_folder = array_merge($listRank, $folder);
             $rank_folder = array_unique($rank_folder);
         }
         $user["User"]["rank_folder"] = implode(",", $rank_folder);
         $this->User->save($user);
     }
     return $rank_folder;
 }
开发者ID:Quang2727,项目名称:Kaopass,代码行数:30,代码来源:FolderUser.php

示例3: getlog_approve_sales

 public function getlog_approve_sales($salesorder_id=NULL)
 {
     APP::import('Model','Logactivity');
     $this->Logactivity  =   new Logactivity();
     $log_list    =    $this->Logactivity->find('first',array('conditions'=>array('Logactivity.logid'=>$salesorder_id)));
     return $log_list['User']['username'];
 }
开发者ID:ArunPrasaath,项目名称:bs,代码行数:7,代码来源:LogHelper.php

示例4: dashboard_customer_name

	public function dashboard_customer_name($module = NULL ,$value = NULL ,$chk_fld = NULL ,$get_fld = NULL )
    {
        APP::import('Model',$module);
        $this->$module   =   new $module();
        $result = $this->$module->find('first',array('conditions'=>array($module.'.'.$chk_fld=>$value)));
        if(!empty($result[$module][$get_fld])) return $result[$module][$get_fld];
    }
开发者ID:ArunPrasaath,项目名称:bs,代码行数:7,代码来源:AppHelper.php

示例5: getCountFolder

 /**
  * count shop in folder
  * 
  */
 public function getCountFolder($shop_id)
 {
     APP::import("Model", array("FolderShop"));
     $this->FolderShop = new FolderShop();
     $data = $this->FolderShop->find("count", array("conditions" => array("FolderShop.shop_id" => $shop_id)));
     return $data;
 }
开发者ID:Quang2727,项目名称:Kaopass,代码行数:11,代码来源:Shop.php

示例6: _getDbConnectInfo

 /**
  * データベースの接続先情報を取得する
  * 
  * @access private
  * @author sakuragawa
  */
 private function _getDbConnectInfo()
 {
     $dbConfigInfo = array();
     $dbConfig = new DATABASE_CONFIG();
     // 読み込まれているModel分ループ
     foreach ($this->controller->modelNames as $key => $val) {
         APP::import('Model', $this->controller->modelNames[$key]);
         $model = new $this->controller->modelNames[$key]();
         $useDbConfig = $model->useDbConfig;
         if (!isset($dbConfig->{$useDbConfig})) {
             // 定義されてない
             unset($model);
             continue;
         }
         // 接続設定
         $one = $dbConfig->{$useDbConfig};
         // 必要な分のみ取り出し
         $buf['driver'] = $one['driver'];
         $buf['host'] = $one['host'];
         $buf['database'] = $one['database'];
         if (count($dbConfigInfo) != 0) {
             // 初回以外
             if (!in_array($buf, $dbConfigInfo)) {
                 $dbConfigInfo[$useDbConfig] = $buf;
             }
         } else {
             // 初回
             $dbConfigInfo[$useDbConfig] = $buf;
         }
         unset($model);
     }
     return $dbConfigInfo;
 }
开发者ID:kozo,项目名称:debug_kit_database_connection,代码行数:39,代码来源:database_connection_panel.php

示例7: checktag_list

 public function checktag_list($group_id=NULL)
 {
     APP::import('Model','Customer');
     $this->Customer  =   new Customer();
     $group_data  =    $this->Customer->find('all',array('conditions'=>array('Customer.customergroup_id'=>$group_id,'Customer.status'=>1)));
     return count($group_data);
 }
开发者ID:ArunPrasaath,项目名称:bs,代码行数:7,代码来源:CustomerHelper.php

示例8: NewAnnex

 function NewAnnex()
 {
     APP::import('Model', 'Annex');
     $this->Annex = new Annex();
     $this->Annex->create();
     $this->Annex->save();
     return $this->Annex->getLastInsertID();
 }
开发者ID:tjabdoullah,项目名称:cakephp-ready,代码行数:8,代码来源:AnnexesHelper.php

示例9: get_customer_name

 public function get_customer_name($customer_id=NULL)
 {
     APP::import('Model','Clientpo');
     $this->Customer  =   new Customer();
     $customer    =    $this->Customer->find('first',array('conditions'=>array('Customer.id'=>$customer_id),'fields'=>array('Customertagname')));
     if(!empty($customer)):
            return  $customer['Customer']['Customertagname'];
         endif;
 }
开发者ID:ArunPrasaath,项目名称:bs,代码行数:9,代码来源:ClientPOHelper.php

示例10: Add

 public function Add($userId, $text)
 {
     APP::import('Model', 'Log');
     $this->Log = new Log();
     $this->Log->create();
     $this->Log->set('user_id', $userId);
     $this->Log->set('message', $text);
     $this->Log->save();
 }
开发者ID:tjabdoullah,项目名称:cakephp-ready,代码行数:9,代码来源:LogsHelper.php

示例11: blacklistCheck

 public function blacklistCheck($data)
 {
     $site_url = strtolower($data['site_url']);
     //get restricted list from db
     APP::import("Model", "RestrictedName");
     $this->RestrictedName = new RestrictedName();
     if (!$this->RestrictedName->checkName($site_url)) {
         return false;
     }
     return true;
 }
开发者ID:kameshwariv,项目名称:testexample,代码行数:11,代码来源:PresenterSite.php

示例12: checkdepartment_value

 public function checkdepartment_value($user_id=NULL,$department_id=NULL)
 {
     APP::import('Model','UserDepartment');
     $this->UserDepartment  =   new UserDepartment();
     $userdepartment  =    $this->UserDepartment->find('all',array('conditions'=>array('UserDepartment.user_id'=>$user_id,'UserDepartment.department_id'=>$department_id)));
     if(count($userdepartment)>0):
         return TRUE;
         else:
         return FALSE;
     endif;
 }
开发者ID:ArunPrasaath,项目名称:bs,代码行数:11,代码来源:UserHelper.php

示例13: GetModelValueCount

 public function GetModelValueCount()
 {
     APP::import('Model', 'Scholar');
     $this->Scholar = new Scholar();
     $this->Scholar->recursive = -1;
     $count = $this->Scholar->find('count', array('conditions' => array('Scholar.scholar_situation =' => '0')));
     if ($count == 0) {
         return "";
     }
     return "<span class='badge badge-danger'>" . $count . "</span>";
 }
开发者ID:tjabdoullah,项目名称:cakephp-ready,代码行数:11,代码来源:MenuHelper.php

示例14: share

 function share($hasp = null)
 {
     $result = array("data" => array(), "error" => 1);
     if (empty($hasp)) {
         $user_id = @$this->request->data['user_id'];
         $folder_id = @$this->request->data['folder_id'];
         $this->user_id = $this->User->getUserIdByAPIToken(@$this->request->data['api_token']);
     } else {
         $secret = explode(self::PREFIX, Security::cipher(base64_decode($hasp), Configure::read('Security.salt')));
         if (count($secret) < 4) {
             return $this->redirect(self::APP_STORE);
         }
         $this->user_id = $secret[0];
         $user_id = $secret[1];
         $folder_id = $secret[2];
     }
     if (empty($user_id) || empty($folder_id) || empty($this->user_id)) {
         if (empty($hasp)) {
             return $this->responseOk($result);
         } else {
             return $this->redirect(self::APP_STORE);
         }
     } else {
         $my_user = $this->User->findById($this->user_id);
         $user = $this->User->findById($user_id);
         $folder = $this->FolderUser->find("first", array("conditions" => array("FolderUser.id" => $folder_id, "FolderUser.user_id" => $this->user_id)));
         if (empty($user) || empty($folder) || empty($my_user)) {
             if (empty($hasp)) {
                 return $this->responseOk($result);
             } else {
                 return $this->redirect(self::APP_STORE);
             }
         }
     }
     if (empty($hasp)) {
         $str = $this->randomString();
         $hasp = $this->safe_b64encode(Security::cipher($this->user_id . self::PREFIX . $user_id . self::PREFIX . $folder_id . self::PREFIX . $str, Configure::read('Security.salt')));
         $link = Router::url('/', true) . "Kaopass/share/{$hasp}";
         $result["error"] = 0;
         $result["data"] = $link;
         return $this->responseOk($result);
     } else {
         APP::import("Model", array("FolderShare"));
         $folderShare = new FolderShare();
         $folderShareData = $folderShare->find("first", array("conditions" => array("FolderShare.folder_id" => $folder_id, "FolderShare.user_id" => $user_id)));
         if ($folderShareData) {
             return $this->redirect(self::APP_KAOPASS);
         }
         $dataSave = array('user_id' => $user_id, "folder_id" => $folder_id);
         $folderShare->create();
         $folderShare->save($dataSave);
         return $this->redirect(self::APP_KAOPASS);
     }
 }
开发者ID:Quang2727,项目名称:Kaopass,代码行数:54,代码来源:KaopassController.php

示例15: main

 public function main()
 {
     //run daily sales report
     APP::import("Model", "ReportDailySales");
     $this->ReportDailySales = new ReportDailySales();
     $this->ReportDailySales->generateDailySalesReport();
     //run daily order report
     APP::import("Model", "ReportDailyOrders");
     $this->ReportDailyOrders = new ReportDailyOrders();
     $this->ReportDailyOrders->generateDailyOrdersReport();
 }
开发者ID:kameshwariv,项目名称:testexample,代码行数:11,代码来源:ReportingShell.php


注:本文中的APP::import方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。