initial commit
This commit is contained in:
37
app/Model/Order.php
Normal file
37
app/Model/Order.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
class Order extends AppModel
|
||||
{
|
||||
var $name='Order';
|
||||
|
||||
|
||||
|
||||
function list($conditions = array(), $order = 'id desc' )
|
||||
{
|
||||
return $this->find('all', array(
|
||||
'conditions' => $conditions,
|
||||
'order' => $order,
|
||||
));
|
||||
}
|
||||
|
||||
function add($inputData)
|
||||
{
|
||||
$result = false;
|
||||
|
||||
if(!empty($inputData))
|
||||
{
|
||||
$fileds = array();
|
||||
$dbData["Order"] = $inputData;
|
||||
if($this->save($dbData,false,$fileds)){
|
||||
$dbData["Order"]['id'] = $this->id;
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
return array($result,$dbData["Order"]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user