當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Docs::findOne方法代碼示例

本文整理匯總了PHP中Docs::findOne方法的典型用法代碼示例。如果您正苦於以下問題:PHP Docs::findOne方法的具體用法?PHP Docs::findOne怎麽用?PHP Docs::findOne使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Docs的用法示例。


在下文中一共展示了Docs::findOne方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ini

 private function ini()
 {
     if ($this->valuedate == null) {
         $this->valuedate = Record::writeDate(time());
     }
     if (!$this->ini) {
         $this->_precision = Yii::$app->params['precision'];
         $item = Item::findByPk($this->item_id, $this->valuedate);
         if (is_null($item)) {
             $this->iVatRate = 0;
         } else {
             $this->iVatRate = $item->vat;
         }
         //for vat resons...
         //if ($this->rate == 0) {
         $this->rate = Currates::GetRate($this->currency_id, $this->valuedate);
         //}
         if ($this->doc_rate == 0) {
             $doc = Docs::findOne($this->doc_id);
             $this->doc_rate = Currates::GetRate($doc->currency_id, $this->valuedate);
         }
         $this->ini != $this->ini;
     }
 }
開發者ID:chaimvaid,項目名稱:linet3,代碼行數:24,代碼來源:Docdetails.php

示例2: refnumDocsLink

 public function refnumDocsLink()
 {
     $str = '';
     $array = explode(",", $this->refnum1);
     foreach ($array as $docid) {
         $doc = Docs::findOne($docid);
         if ($doc !== null) {
             $str .= Html::a(Html::encode(Yii::t('app', $doc->docType->name) . " #" . $doc->docnum), yii\helpers\BaseUrl::base() . "/docs/view/{$docid}");
         } else {
             $str .= $docid;
         }
         $str .= ",";
         //echo $docid;
     }
     return rtrim($str, ",");
 }
開發者ID:chaimvaid,項目名稱:linet3,代碼行數:16,代碼來源:Transactions.php

示例3: saveRef

 public function saveRef($id, $total)
 {
     $str = $this->refnum;
     //save new values
     $sum = 0;
     $tmp = explode(",", rtrim($str, ","));
     foreach ($tmp as $id) {
         //lets do this
         //if($id==$this->id){
         //    throw new \Exception(Yii::t('app','You cannot save doc as a refnum'));
         //}
         $doc = Docs::findOne((int) $id);
         if ($doc !== null) {
             $sum += $doc->total;
             //adam: need to multi currency!
             if ($sum <= $total) {
                 $doc->refstatus = Docs::STATUS_CLOSED;
             } else {
                 $doc->refstatus = Docs::STATUS_OPEN;
             }
             $doc->refnum = $id;
             $doc->save();
         }
     }
     //$this->refnum=$str;
 }
開發者ID:chaimvaid,項目名稱:linet3,代碼行數:26,代碼來源:FormOutcome.php


注:本文中的Docs::findOne方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。