本文整理汇总了PHP中Docs::getMax方法的典型用法代码示例。如果您正苦于以下问题:PHP Docs::getMax方法的具体用法?PHP Docs::getMax怎么用?PHP Docs::getMax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Docs
的用法示例。
在下文中一共展示了Docs::getMax方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: import
public function import()
{
//add warehouse
$array = $this->read();
//companies
$company = $this->parseLine($array['companies'][0]);
$prefix = $company[1];
//echo $prefix;
$this->saveSetting('company.name', $company[0]);
$this->saveSetting('company.vat.id', $company[3]);
$this->saveSetting('company.address', $company[4]);
$this->saveSetting('company.city', $company[5]);
$this->saveSetting('company.zip', $company[6]);
$this->saveSetting('company.phone', $company[7]);
$this->saveSetting('company.fax', $company[8]);
$this->saveSetting('company.website', $company[9]);
$this->saveSetting('company.tax.rate', $company[10]);
$this->saveSetting('company.tax.irs', $company[11]);
//$this->saveSetting('account.100.srctax', $company[12]);
$this->saveSetting('company.tax.vat', $company[13]);
//exit;
///*
if (isset($array['accounts'])) {
$this->imprtAccounts($array['accounts'], $prefix);
}
if (isset($array['items'])) {
$this->imprtItems($array['items'], $prefix);
}
if (isset($array['docs'])) {
$this->imprtDocs($array['docs'], $prefix);
}
if (isset($array['cheques'])) {
$this->imprtCheques($array['cheques'], $prefix);
}
if (isset($array['docdetails'])) {
$this->imprtDocdetails($array['docdetails'], $prefix);
}
if (isset($array['transactions'])) {
$this->imprtTransactions($array['transactions'], $prefix);
}
if (isset($array['bankbook'])) {
$this->imprtBankbooks($array['bankbook'], $prefix);
}
if (isset($array['correlation'])) {
$this->imprtCorrelations($array['correlation'], $prefix);
}
//*/
//vat rate
$acc = Accounts::model()->findByPk(100);
$acc->src_tax = $company[12];
$acc->save();
$acc = Accounts::model()->findByPk(101);
$acc->src_tax = $company[12];
$acc->save();
//add warehouse
//add genral item
//get transaction num
$this->saveSetting('company.transaction', Transactions::getMax() + 1);
//get docnums
$types = Doctype::model()->findAll();
foreach ($types as $type) {
$type->last_docnum = Docs::getMax($type->id);
$type->save();
}
//contacthist
//contacts??
//tranrep??
}
示例2: last_docnumVal
public function last_docnumVal($attribute, $params)
{
$num = Docs::getMax($this->id);
if ($num != null) {
if (docs::getMax($this->id) != $this->{$attribute}) {
$this->addError($attribute, Yii::t('app', 'Not a valid number, last number:') . $num);
}
}
return true;
}