public function actionIndex() { if (isset($_GET['id'])) { $request = Yii::$app->request; $id = $request->get('id'); $Order = new Order(); $order = ORDER::find()->where(['order_id' => $id])->one(); $Orderlist = new OrderList(); $product = $Orderlist->getAllProductsFromCard($id); return $this->render('index', ['order' => $order, 'product' => $product]); } }
/** * Добавление заказа в базу */ public function actionAddorder() { $id = Order::getLastId(); exit(var_dump($_POST)); if ($id) { $id = current($id) + 1; } else { $id = 1; } foreach ($_POST as $key => $value) { if (substr($key, 0, 3) === 'pid') { $product = Product::getProd($value); $model = new OrderList(); $model->attributes = array('order_id' => $id, 'product_id' => $value, 'product_price' => $product['price'], 'modification_id' => $_SESSION['orders'][$value]['modifid'], 'mounting' => '0'); $model->save(); } } Order::createOrder($id, $_POST['Order']['mounting'], $_POST['Order']['clientname'], $_POST['Order']['phone'], $_POST['Order']['address'], $_POST['Order']['date'], $_POST['Order']['time'], date('d.m.Y H:i:s', time())); $this->redirect(array('clearcart')); }
<?php /* @var $this ProductController */ Yii::app()->clientScript->registerCssFile('../css/cartlist.css'); $orderPrice = 0; $orderNum = 0; $orderPricePay = 0; $orderPayNum = 0; $orderList = new OrderList($this->companyId, $this->siteNoId); if ($orderList->order) { $orderProductList = $orderList->OrderProductList($orderList->order['lid'], 0, 1); $orderProductListPay = $orderList->OrderProductList($orderList->order['lid'], 1, 0, 1); $price = $orderList->OrderPrice(0, 1); $priceArr = explode(':', $price); $orderPrice = $priceArr[0]; $orderNum = $priceArr[1]; $pricePay = $orderList->OrderPrice(1, 0, 1); $pricePayArr = explode(':', $pricePay); $orderPricePay = $pricePayArr[0]; $orderPayNum = $pricePayArr[1]; } else { $orderProductList = array(); $orderProductListPay = array(); } ?> <script type="text/javascript" src="../js/product/taste.js"></script> <div class="top"><a href="index"><div class="back"><img src="../img/product/back.png" /> <?php echo yii::t('app', '返回'); ?> </div></a><a id="order" href="javascript:;"><button class="create-order"><?php echo yii::t('app', '下单');
public function actionOrderKitchen() { $companyId = Yii::app()->request->getParam('companyId', 0); $orderId = Yii::app()->request->getParam('orderid', "0"); $orderStatus = Yii::app()->request->getParam('orderstatus', "0"); $productList = Yii::app()->request->getPost('productlist', "0"); $orderTasteIds = Yii::app()->request->getPost('ordertasteids', "0"); //只传递新追加的 $orderTasteMemo = Yii::app()->request->getPost('ordertastememo', "0"); $callId = Yii::app()->request->getParam('callId', "0"); //返回json挂单成功或失败gi //如果orderId是0,表示是临时台, //要开台、生成新的订单//暂时不处理 ///Yii::app()->end(json_encode(array('status'=>false,'msg'=>$productList))); if (!Until::validOperateJson($companyId, $this)) { Yii::app()->end(json_encode(array('status' => false, 'msg' => "云端不能操作本地数据"))); } if ($orderId == "0") { //临时台,没有开过台的, //要开台, //生成新的订单, //然后才有后面的插入!! //var_dump($order);exit; // if(empty($order)) // { // Until::validOperate($companyId,$this); // // $order=new Order(); // $se=new Sequence("order"); // $order->lid = $se->nextval(); // $order->dpid=$companyId; // $order->create_at = date('Y-m-d H:i:s',time()); // $order->lock_status = '0'; // $order->order_status = '1'; // $order->site_id = $siteNo->site_id; // $order->number = $siteNo->number; // $order->is_temp = $siteNo->is_temp; // //var_dump($order);exit; // $order->save(); // } } //$syscallId = Yii::app()->request->getParam('syscallId',0); //$autoaccount = Yii::app()->request->getParam('autoaccount',0); $order = new Order(); $siteNo = new SiteNo(); $site = new Site(); ///***********insert to order feedback ///*************print if ($orderId != '0') { $order = Order::model()->with('company')->find(' t.lid=:lid and t.dpid=:dpid and t.order_status in(1,2,3)', array(':lid' => $orderId, ':dpid' => $companyId)); //Yii::app()->end(json_encode(array('status'=>false,'msg'=>"234"))); if (empty($order)) { Yii::app()->end(json_encode(array('status' => false, 'msg' => "该订单不存在"))); } $criteria = new CDbCriteria(); $criteria->condition = 't.dpid=' . $companyId . ' and t.site_id=' . $order->site_id . ' and t.is_temp=' . $order->is_temp; $criteria->order = ' t.lid desc '; $siteNo = SiteNo::model()->find($criteria); //order site 和 siteno都需要更新状态 所以要取出来 if ($order->is_temp == "0") { $criteria2 = new CDbCriteria(); $criteria2->condition = 't.dpid=' . $companyId . ' and t.lid=' . $order->site_id; $criteria2->order = ' t.lid desc '; $site = Site::model()->with("siteType")->find($criteria2); } } //Yii::app()->end(json_encode(array('status'=>false,'msg'=>"234"))); $savejson = OrderList::createOrder($companyId, $orderId, $orderStatus, $productList, $orderTasteIds, $orderTasteMemo, $callId, $order, $site, $siteNo); //$jobids=array(); //Yii::app()->end(json_encode($savejson)); // if(!$savejson["status"]) // { // $ret=json_encode($savejson); // }else{ // $ret= json_encode(Helper::printKitchenAll2($order,$site,$siteNo,false)); // } Yii::app()->end(json_encode($savejson)); }
<?php /* @var $this ProductController */ Yii::app()->clientScript->registerCssFile('../css/order.css'); $orderPrice = 0; $orderNum = 0; $orderList = new OrderList($this->companyId, $this->siteNoId); if ($orderList->order) { $orderProductList = $orderList->OrderProductList($orderList->order['lid'], 0, 0, 1); $price = $orderList->OrderPrice(0, 1); $priceArr = explode(':', $price); $orderPrice = $priceArr[0]; $orderNum = $priceArr[1]; } else { $orderProductList = array(); } //全单口味 $tasteIds = TasteClass::getOrderTaste($orderList->order['lid'], 1, $this->companyId); ?> <script type="text/javascript" src="../js/product/taste.js"></script> <form action="orderList?confirm=1&orderId=<?php echo $orderList->order['lid']; ?> " method="post"> <div class="top"><?php echo yii::t('app', '我的订单'); ?> </div> <div class="product-title"><?php echo yii::t('app', '订单已经被锁定,其他人不能修改,需要最终修改数量和口味点击'); ?>
public function __construct($name = null, $owner = null, $order = Cons::YES, $filename) { parent::__construct($name, $owner, $order); $this->setIstok($filename); }
public static function Create($orderList) { OrderList::create(array('order_id' => $orderList->order_id, 'product_id' => $orderList->product_id)); }
echo Money::priceFormat($orderPricePay); ?> </span></div><div class="order-top-right"><button class="online-pay" onclick="callpay()">微信支付</button></div></div> <div class="order-time"><div class="order-time-left"><?php echo date('Y-m-d H:i:s', time()); ?> </div></div> <?php foreach ($orderProductListPay as $key => $orderProduct) { ?> <!--非套餐--> <?php if ($key) { ?> <div class="order-category"><?php echo OrderList::GetCatoryName($key, $dpid); ?> </div> <?php foreach ($orderProduct as $order) { ?> <div class="order-product"> <div class="order-product-left"><img src="<?php echo $order['main_picture']; ?> " /></div> <div class="order-product-right"> <div class="right-up"><?php echo $order['product_name']; ?> </div>
public function actionOrder() { $orderId = Yii::app()->request->getParam('orderId'); $goodsIds = isset($_POST) ? $_POST : array(); if (!($goodsIds && OrderList::UpdateOrder($this->companyId, $orderId, $goodsIds))) { $this->redirect(array('/product/orderList')); } $this->render('order'); }