예제 #1
0
 /**
  * show Statuses
  */
 public function getStatuses($paginateItems = 50)
 {
     app('veer')->loadedComponents['counted']['orders'] = \Veer\Models\Order::select(\DB::raw('count(*) as orders_count, status_id'))->groupBy('status_id')->lists('orders_count', 'status_id');
     app('veer')->loadedComponents['counted']['orders_history'] = \Veer\Models\OrderHistory::select(\DB::raw('count(*) as orders_count, status_id'))->groupBy('status_id')->lists('orders_count', 'status_id');
     app('veer')->loadedComponents['counted']['bills'] = \Veer\Models\OrderBill::select(\DB::raw('count(*) as orders_count, status_id'))->groupBy('status_id')->lists('orders_count', 'status_id');
     return \Veer\Models\OrderStatus::orderBy('manual_order', 'asc')->paginate($paginateItems);
 }
예제 #2
0
파일: Order.php 프로젝트: artemsk/veer-core
 /**
  * Query Builder: 
  * 
  * - who: 1 Bill
  * - with: 
  * - to whom: make() | order/bills/{id}
  * 
  * @later: 'order', 'user', 'status', 'payment'
  */
 public function getBillWithSite($siteId, $id, $lnk, $userId = null, $bypassUser = false)
 {
     $items = \Veer\Models\OrderBill::where('link', '=', $lnk)->where('id', '=', $id);
     if (!$bypassUser) {
         $items->where('users_id', '=', $userId)->where('sites_id', '=', $siteId);
     }
     return $items->first();
 }
예제 #3
0
 public function delete($id)
 {
     \Veer\Models\Order::where('payment_method_id', '=', $id)->update(['payment_method_id' => 0]);
     \Veer\Models\OrderBill::where('payment_method_id', '=', $id)->update(['payment_method_id' => 0]);
     \Veer\Models\OrderPayment::destroy($id);
     event('veer.message.center', trans('veeradmin.payment.delete') . " " . $this->restore_link('OrderPayment', $id));
     return $this;
 }
예제 #4
0
 /**
  * delete Status
  */
 public function delete($id)
 {
     \Veer\Models\Order::where('status_id', '=', $id)->update(['status_id' => 0]);
     \Veer\Models\OrderBill::where('status_id', '=', $id)->update(['status_id' => 0]);
     \Veer\Models\OrderHistory::where('status_id', '=', $id)->update(['status_id' => 0]);
     \Veer\Models\OrderStatus::destroy($id);
     event('veer.message.center', trans('veeradmin.status.delete') . " " . $this->restore_link('OrderStatus', $id));
     return $this;
 }
예제 #5
0
파일: Bill.php 프로젝트: artemsk/veer-core
 public function delete()
 {
     \Veer\Models\OrderBill::where('id', '=', $this->id)->delete();
     return $this;
 }