本文整理汇总了PHP中Orders::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Orders::unsetAttributes方法的具体用法?PHP Orders::unsetAttributes怎么用?PHP Orders::unsetAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orders
的用法示例。
在下文中一共展示了Orders::unsetAttributes方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionList
/**
* List all orders and
*/
public function actionList()
{
$this->layout = "column2";
$model = new Orders();
$model->unsetAttributes();
$listDataProvider = null;
if (isset($_POST['Orders'])) {
$model->attributes = $_POST['Orders'];
}
if (isset($_POST['searchWhat'])) {
$criteria = new CDbCriteria();
if ($_POST['searchWhat'] === 'name') {
$criteria->compare("concat(tbl_customer.title,' ',tbl_customer.firstname,' ',tbl_customer.lastname)", $_POST['searchName'], true, "OR");
$criteria->join = "left join tbl_customer on tbl_customer.id = t.customer_id";
$criteria->order = "t.order_date DESC";
// $criteria->compare
} else {
if ($_POST['searchWhat'] === 'order_date') {
$dateFormatted = date("Y-m-d", strtotime($_POST['searchOrderDate']));
$criteria->addCondition("date(order_date) = '" . $dateFormatted . "'");
$criteria->order = "t.order_date DESC";
}
}
$listDataProvider = new CActiveDataProvider('Orders', array('criteria' => $criteria, 'pagination' => false));
// print_r($listDataProvider->criteria);
// print_r($listDataProvider->data);
// die();
} else {
$listDataProvider = $model->search();
}
$this->render('list', array('model' => $model, 'listDataProvider' => $listDataProvider));
}
开发者ID:kevindaus,项目名称:Order-Billing-Inventory-System-Marcials-Furniture,代码行数:35,代码来源:InvoiceController.php
示例2: actionIndex
public function actionIndex()
{
$model = new Orders('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Orders'])) {
$model->attributes = $_GET['Orders'];
}
$this->render('index', array('order' => $model));
}
示例3: actionIndex
public function actionIndex()
{
$this->layout = '//layouts/admin';
$this->pageTitle = 'Заказы';
$this->breadcrumbs = array('Заказы');
$model = new Orders('search');
$model->unsetAttributes();
if (isset($_GET['Orders'])) {
$model->attributes = $_GET['Orders'];
}
$this->render('index', array('model' => $model));
}
示例4: actionIndex
/**
* Manages all models.
*/
public function actionIndex()
{
if (isset($_POST['del'])) {
$model = Orders::model()->deleteByPk($_POST['id']);
}
$model = new Orders('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Orders'])) {
$model->attributes = $_GET['Orders'];
}
$this->render('index', array('model' => $model));
}
示例5: actionIndex
/**
* Manages all models.
*/
public function actionIndex()
{
$this->layout = '/layouts/column1';
$model = new Orders('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Orders'])) {
$model->attributes = $_GET['Orders'];
}
if (isset($_POST['drop_status']) && isset($_POST['id'])) {
$setStatus = Orders::model()->updateByPk($_POST['id'], array('status' => $_POST['drop_status']));
}
$this->render('index', array('model' => $model));
}
示例6: actionIndex
public function actionIndex()
{
$ordersModel = new Orders('search');
$ordersModel->unsetAttributes();
// clear any default values
if (isset($_GET['Orders'])) {
$ordersModel->attributes = $_GET['Orders'];
}
$ordersModel->user_id = Yii::app()->user->id;
$carsModel = new Cars('search');
$carsModel->unsetAttributes();
// clear any default values
if (isset($_GET['Cars'])) {
$carsModel->attributes = $_GET['Cars'];
}
$carsModel->ower_id = Yii::app()->user->id;
$this->render('index', array('user' => $this->loadModel(Yii::app()->user->id), 'userid' => Yii::app()->user->id, 'orders' => $ordersModel, 'cars' => $carsModel));
}
示例7: actions
* Declares class-based actions.
*/
public function actions()
{
return array('captcha' => array('class' => 'CCaptchaAction', 'backColor' => 0xffffff), 'page' => array('class' => 'CViewAction'));
}
/**
* This is the default 'index' action that is invoked
* when an action is not explicitly requested by users.
*/
public function actionIndex()
{
if (Yii::app()->user->isOperator()) {
$acceptedOrders = new Orders('search');
$acceptedOrders->unsetAttributes();
$acceptedOrders->operator_id = Yii::app()->user->id;
$acceptedOrders->status = 'accepted';
$operator = User::model()->findByPk(Yii::app()->user->id);
if (isset($_GET['Orders'])) {
$acceptedOrders->attributes = $_GET['Orders'];
}
示例8: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Orders('search');
$model->unsetAttributes();
// clear any default values
$model->status = 'open';
if (isset($_GET['Orders'])) {
$model->attributes = $_GET['Orders'];
}
// $dtPrvdr = $model->search();
// $dtPrvdr->criteria->with = array('client');
$this->render('admin', array('model' => $model));
}
示例9: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Orders('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Tenders'])) {
$model->attributes = $_GET['Tenders'];
}
$this->render('admin', array('model' => $model));
}
示例10: actionExport
public function actionExport()
{
$model = new Orders();
$model->unsetAttributes();
// clear any default values
if (isset($_POST['Orders'])) {
$model->attributes = $_POST['Orders'];
}
$exportType = $_POST['fileType'];
$this->widget('ext.heart.export.EHeartExport', array('title' => 'List of Orders', 'dataProvider' => $model->search(), 'filter' => $model, 'grid_mode' => 'export', 'exportType' => $exportType, 'columns' => array('order_id', 'expense_id', 'just_id', 'type', 'count', 'table_id')));
}