本文整理汇总了PHP中Customers::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Customers::model方法的具体用法?PHP Customers::model怎么用?PHP Customers::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customers
的用法示例。
在下文中一共展示了Customers::model方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadModel
/**
* Returns the data model based on the primary key given in the GET variable.
* If the data model is not found, an HTTP exception will be raised.
* @param integer $id the ID of the model to be loaded
* @return Customers the loaded model
* @throws CHttpException
*/
public function loadModel($id)
{
$model = Customers::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例2: array
$this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => 'SalesInvoices[due_date]', 'model' => $model1, 'attribute' => 'due_date', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'yy-mm-dd'), 'htmlOptions' => array('style' => 'height:20px;', 'value' => '2015-01-13')));
?>
<?php
echo $form->error($model1, 'due_date');
?>
</div>
</div>
<div class="row">
<?php
echo $form->labelEx($model1, 'customer_id');
?>
<?php
$this->widget('bootstrap.widgets.select2.ESelect2', array('model' => $model1, 'attribute' => 'customer_id', 'data' => CHtml::listData(Customers::model()->findAll(), 'id', 'customerName'), 'htmlOptions' => array('class' => '')));
?>
<?php
echo $form->error($model1, 'customer_id');
?>
</div>
<br>
<div id="form-content" style="margin-right: 5%;">
<?php
if ($mode === 'update') {
foreach ($model2 as $indmodel) {
$this->renderPartial('_form-sales-info', array('form' => $form, 'model2' => $indmodel, 'sts' => $sts));
$sts++;
}
} else {
$this->renderPartial('_form-sales-info', array('form' => $form, 'model2' => $model2, 'sts' => 0));
示例3: array
<h2>Update MoneyReceived</h2>
<div style="border: 1px inset gold;padding: 3%;">
<span><b>Customer: </b><?php
echo Customers::model()->findByPk(SalesInvoices::model()->findByPk($id)->customer_id)->customerName;
?>
</span>
<br>
<br>
<span><b>Sales Invoice: </b><?php
echo $id;
?>
</span>
<br>
<br>
<?php
$this->renderPartial('_form', array('model' => $model, 'id' => $id));
?>
</div>
示例4:
<b>Issue Date</b><br>
<span><?php
echo $model->issue_date;
?>
</span><br><br>
<b>Invoice Number</b><br>
<span><?php
echo $model->id;
?>
</span>
</div>
<br>
<div style="font-family: calibri;line-break: loose;">
<b>To:</b>
<span><?php
$customerModel = Customers::model()->findByPk($model->customer_id);
echo $customerModel->customerName;
?>
</span><br>
<b>PAN Address:</b> <span><?php
echo $customerModel->PANNumber;
?>
</span><br>
<b>Billing Address:</b><span><?php
echo $customerModel->BillingAddress;
?>
</span>
</div>
<br>
<br>
<div style="border: 2px inset #000000;">
示例5: getClientCustomersList
public static function getClientCustomersList($clientID)
{
$customers = array();
$condition = new CDbCriteria();
$condition->condition = "t.Client_Client_ID = '" . $clientID . "'";
$condition->addCondition("t.Cust_Active_Relationship = '" . self::ACTIVE_RELATIONSHIP . "'");
$condition->order = 'company.Company_Name ASC';
$customersRes = Customers::model()->with('client.company')->findAll($condition);
if ($customersRes) {
foreach ($customersRes as $customer) {
$customers[$customer->Customer_ID] = ($customer->Cust_ID_Shortcut ? $customer->Cust_ID_Shortcut . ' - ' : '') . $customer->client->company->Company_Name;
}
}
return $customers;
}