Ejemplo n.º 1
0
 /**
  * 显示评价信息
  * GET /rate
  *
  * @return Response
  */
 public function getList()
 {
     //
     $rates = array();
     if (Input::has('shopID')) {
         $shopID = base64_decode(Input::get('shopID'));
         if (0 == strcmp($shopID, ALL_SHOPS_FALG)) {
             $headerShop = (object) array("wy_shop_id" => base64_encode(ALL_SHOPS_FALG), "wy_shop_name" => ALL_SHOPS);
             return View::make('admin.manage.rate.rate', compact('headerShop', 'rates'))->withAll(Lang::get('messages.10015'));
         } else {
             $headerShop = AuthController::checkShop($shopID);
             if (empty($headerShop)) {
                 return View::make('admin.manage.rate.rate', compact('headerShop', 'rates'))->withError(Lang::get('errormessages.-10045'));
             } else {
                 $shop = Shop::where('wy_shop_id', $shopID)->first(array('wy_comprehensive_evaluation', 'wy_service_score', 'wy_goods_score'));
                 $rates = Rate::where('wy_shop_id', $shopID)->orderBy('wy_time', 'desc')->paginate(PERPAGE_COUNT_10, array('wy_comment_id', 'wy_main_order_id', 'wy_user_phone', 'wy_time', 'wy_content'));
                 foreach ($rates as $index => $rate) {
                     $rate->wy_comment_id = base64_encode($rate->wy_comment_id);
                     $mainOrder = MainOrder::where('wy_main_order_id', $rate->wy_main_order_id)->first(array('wy_order_number'));
                     if (!empty($mainOrder)) {
                         $rate->wy_order_number = $mainOrder->wy_order_number;
                     } else {
                         $rate->wy_order_number = Lang::get('errormessages.-10058');
                     }
                     $rate->wy_main_order_id = base64_encode($rate->wy_main_order_id);
                 }
                 return View::make('admin.manage.rate.rate', compact('headerShop', 'shop', 'rates'));
             }
         }
     } else {
         return View::make('admin.manage.rate.rate', compact('rates'))->withError(Lang::get('errormessages.-10045'));
     }
 }
Ejemplo n.º 2
0
 public function getListInfo()
 {
     $shopID = base64_decode(Input::get('shopID'));
     $mainOrderID = base64_decode(Input::get('mainOrderID'));
     $disableChange = DEFAULT_0;
     $headerShop = AuthController::checkShop($shopID);
     if (!empty($headerShop)) {
         $mainOrder = MainOrder::where('wy_main_order_id', $mainOrderID)->where('wy_shop_id', $shopID)->first(array('wy_main_order_id', 'wy_shop_id', 'wy_order_number', 'wy_recv_name', 'wy_recv_addr', 'wy_recv_phone', 'wy_consumption_money', 'wy_actual_money', 'wy_order_state', 'wy_order_state_flow', 'wy_generate_time', 'wy_confirm_time', 'wy_send_time', 'wy_arrive_time', 'wy_reminder_flag', 'wy_reminder_count', 'wy_reminder_time', 'wy_refuse_time', 'wy_cancel_time', 'wy_user_note'));
         if (!empty($mainOrder)) {
             $orderStatus = Dictionary::where('wy_dic_id', DIC_ORDER_STATUS)->where('wy_dic_item_id', $mainOrder->wy_order_state)->first(array('wy_dic_value'));
             $mainOrder->wy_order_state_name = $orderStatus->wy_dic_value;
             $reminderFlag = Dictionary::where('wy_dic_id', DIC_REMINDER_FLAG)->where('wy_dic_item_id', $mainOrder->wy_reminder_flag)->first(array('wy_dic_value'));
             $mainOrder->wy_reminder_flag_name = $reminderFlag->wy_dic_value;
             $subOrders = MainOrder::find($mainOrder->wy_main_order_id)->subOrders()->get(array('wy_goods_id', 'wy_goods_name', 'wy_goods_unit_price', 'wy_goods_amount', 'wy_goods_total_price'));
             $mainOrder->subOrders = $subOrders;
             $mainOrder->wy_shop_name = $headerShop->wy_shop_name;
             $mainOrder->wy_shop_id = base64_encode($mainOrder->wy_shop_id);
             $mainOrder->wy_main_order_id = base64_encode($mainOrder->wy_main_order_id);
             //订单流的处理
             $orderStatFlows = str_split($mainOrder->wy_order_state_flow);
             return View::make('admin.template.order.orderdetail', compact('headerShop', 'disableChange', 'mainOrder', 'orderStatFlows'));
         } else {
             return View::make('admin.template.order.orderdetail', compact('headerShop', 'disableChange'))->withError(Lang::get('errormessages.-10068'));
         }
     } else {
         return View::make('admin.template.order.orderdetail', compact('disableChange'))->withError(Lang::get('errormessages.-10068'));
     }
 }
Ejemplo n.º 3
0
 protected function getSingleTradeInfo($shopID, &$totalTurnover, &$totalOrderCount, &$newOrderCount)
 {
     $date = Carbon::now()->toDateString();
     $totalTurnover = MainOrder::where('wy_shop_id', $shopID)->where('wy_order_state', ORDER_STATE_4)->whereRaw('date(wy_generate_time) = ?', array($date))->sum('wy_actual_money');
     $totalTurnover = round($totalTurnover, 2);
     $totalOrderCount = MainOrder::where('wy_shop_id', $shopID)->whereRaw('date(wy_generate_time) = ?', array($date))->count();
     $newOrderCount = MainOrder::where('wy_shop_id', $shopID)->where('wy_order_state', ORDER_STATE_1)->whereRaw('date(wy_generate_time) = ?', array($date))->count();
 }
Ejemplo n.º 4
0
 public function getBizReportList()
 {
     $mainOrders = array();
     $conditions = "";
     $params = array();
     $dates = array();
     $shopID = base64_decode(Input::get('shop_id'));
     if (Request::ajax()) {
         if (0 == strcmp($shopID, ALL_SHOPS_FALG)) {
             $userID = Auth::id();
             $shops = Shop::where('wy_shopkeeper', $userID)->where('wy_audit_state', SHOP_AUDIT_STATUS_4)->get(array('wy_shop_id'));
             $shopIDs = array();
             foreach ($shops as $index => $shop) {
                 array_push($shopIDs, $shop->wy_shop_id);
             }
             if (!empty($shopIDs)) {
                 $this->getStatisticsConditions($conditions, $params, $dates, false);
                 if (!empty($conditions) && !empty($params)) {
                     $mainOrders = MainOrder::whereIn('wy_shop_id', $shopIDs)->whereRaw($conditions, $params)->orderBy('wy_generate_time')->paginate(PERPAGE_COUNT_10, array('wy_main_order_id', 'wy_shop_id', 'wy_order_number', 'wy_recv_name', 'wy_generate_time', 'wy_actual_money', 'wy_order_state', 'wy_reminder_flag'));
                     foreach ($mainOrders as $index => $mainOrder) {
                         $orderStatus = Dictionary::where('wy_dic_id', DIC_ORDER_STATUS)->where('wy_dic_item_id', $mainOrder->wy_order_state)->first(array('wy_dic_value'));
                         $mainOrder->wy_order_state_name = $orderStatus->wy_dic_value;
                         $reminderFlag = Dictionary::where('wy_dic_id', DIC_REMINDER_FLAG)->where('wy_dic_item_id', $mainOrder->wy_reminder_flag)->first(array('wy_dic_value'));
                         $mainOrder->wy_reminder_flag_name = $reminderFlag->wy_dic_value;
                         $shop = Shop::where('wy_shop_id', $mainOrder->wy_shop_id)->first(array('wy_shop_name'));
                         if (!empty($shop)) {
                             $mainOrder->wy_shop_name = $shop->wy_shop_name;
                         } else {
                             $mainOrder->wy_shop_name = $headerShop->wy_shop_name;
                         }
                         $mainOrder->wy_shop_id = base64_encode($mainOrder->wy_shop_id);
                         $mainOrder->wy_main_order_id = base64_encode($mainOrder->wy_main_order_id);
                     }
                 }
             } else {
                 $mainOrders = Paginator::make(array(), DEFAULT_0, PERPAGE_COUNT_10);
             }
         } else {
             $headerShop = AuthController::checkShop($shopID);
             if (!empty($headerShop)) {
                 $this->getStatisticsConditions($conditions, $params, $dates, false);
                 if (!empty($conditions) && !empty($params)) {
                     $mainOrders = MainOrder::where('wy_shop_id', $shopID)->whereRaw($conditions, $params)->orderBy('wy_generate_time')->paginate(PERPAGE_COUNT_10, array('wy_main_order_id', 'wy_shop_id', 'wy_order_number', 'wy_recv_name', 'wy_generate_time', 'wy_actual_money', 'wy_order_state', 'wy_reminder_flag'));
                     foreach ($mainOrders as $index => $mainOrder) {
                         $orderStatus = Dictionary::where('wy_dic_id', DIC_ORDER_STATUS)->where('wy_dic_item_id', $mainOrder->wy_order_state)->first(array('wy_dic_value'));
                         $mainOrder->wy_order_state_name = $orderStatus->wy_dic_value;
                         $reminderFlag = Dictionary::where('wy_dic_id', DIC_REMINDER_FLAG)->where('wy_dic_item_id', $mainOrder->wy_reminder_flag)->first(array('wy_dic_value'));
                         $mainOrder->wy_reminder_flag_name = $reminderFlag->wy_dic_value;
                         $mainOrder->wy_shop_name = $headerShop->wy_shop_name;
                         $mainOrder->wy_shop_id = base64_encode($mainOrder->wy_shop_id);
                         $mainOrder->wy_main_order_id = base64_encode($mainOrder->wy_main_order_id);
                     }
                 }
             } else {
                 $mainOrders = Paginator::make(array(), DEFAULT_0, PERPAGE_COUNT_10);
             }
         }
     }
     return View::make('admin.report.trade.bizreportlist', compact('mainOrders'));
 }
Ejemplo n.º 5
0
 /**
  * 打印订单
  *
  * @return Response
  */
 public function getPrint($shop_id, $main_order_id)
 {
     $shopID = base64_decode($shop_id);
     $headerShop = AuthController::checkShop($shopID);
     $mainOrderID = base64_decode($main_order_id);
     if (empty($headerShop)) {
         App::abort(404);
     } else {
         $shop = Shop::where('wy_shop_id', $shopID)->first();
         $shop->wy_shop_id = base64_encode($shop->wy_shop_id);
         $mainOrder = MainOrder::where('wy_shop_id', $shopID)->where('wy_main_order_id', $mainOrderID)->first();
         $subOrders = MainOrder::find($mainOrder->wy_main_order_id)->subOrders()->get(array('wy_goods_id', 'wy_goods_name', 'wy_goods_unit_price', 'wy_goods_amount', 'wy_goods_total_price'));
         $goodsTotalAmout = MainOrder::find($mainOrder->wy_main_order_id)->subOrders()->sum('wy_goods_amount');
         $mainOrder->goodsTotalAmout = $goodsTotalAmout;
         $mainOrder->subOrders = $subOrders;
         $mainOrder->wy_shop_id = base64_encode($mainOrder->wy_shop_id);
         $mainOrder->wy_main_order_id = base64_encode($mainOrder->wy_main_order_id);
         return View::make('admin.print.print', compact('mainOrder', 'shop'));
     }
 }
Ejemplo n.º 6
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     // App::abort(404);
     // App::abort(403, '403');
     // throw new DecryptException("Error Processing Request", 1);
     // return $_ENV;
     // return App::environment();
     // Crypt::setMode('ctr');
     // Crypt::setCipher($cipher);
     //return hash_algos();
     // return base64_decode('MQ==');
     // return urlencode('shop_id=1');
     // return com_create_guid();
     // return base64_encode(12);
     // return hash('sha1', 2);
     // Crypt::setCipher(MCRYPT_SAFER64);
     // Crypt::setMode(MCRYPT_MODE_ECB);
     // $groups = Sentry::findAllGroups();
     // return $groups;
     // $credentials = array(
     //        'email'    => '*****@*****.**',
     //        'password' => 'test',
     //    );
     //    // Authenticate the user
     //    $user = Sentry::authenticate($credentials, false);
     //    return $user;
     // setcookie('test','test',time()+24*60*60);
     // Session::put('password', 'password');
     // Cookie::get('password');
     // return Session::getId();
     // Session::setId(id)
     // return Session::get('intended');
     // return $url->intended;
     $activities = Activity::all();
     $shopActivities = ShopActivity::where('wy_shop_id', 2)->where('wy_enable', ACTIVITY_ENABLE_1)->get(array('wy_activity_id'));
     var_dump($shopActivities);
     return;
     $user = new User();
     $user->wy_user_name = "xx";
     return $user->toJson();
     $mainOrders = MainOrder::with('subOrders')->where('wy_shop_id', 2)->get();
     return $mainOrders;
     $name = DB::table('user')->skip(2)->get(array('wy_user_id', 'wy_user_name'));
     DB::table('users')->where('votes', '>', 100)->sharedLock()->get();
     Log::info();
     var_dump($name);
     return $name;
     return Session::all();
     $user = new User();
     var_dump($user);
     $value = Request::server();
     return $value;
     return urldecode('Mg%3D%3D');
     return base64_encode("all");
     $headShop = new stdObject();
     $headShop->wy_shop_id = "all";
     $headShop->wy_shop_name = "全部店铺";
     // $headShop = (object)array(
     // 	"wy_shop_id" => "all",
     // 	"wy_shop_name" => "全部店铺",
     // );
     var_dump($headShop);
     return $headShop->wy_shop_id;
     return Cookie::get('login_user');
     return base64_decode('NTE=');
     $url = Session::get('url');
     return $url['intended'];
     return Session::all();
     // return $_COOKIE;
     // return base64_decode('YTo2OntzOjY6Il90b2tlbiI7czo0MDoiVHpEcXBUd2NXZlpEaFZWd0VDV1g2eWNvNmkwQ0UxMWg5cThyc3hpZyI7czozOiJ1cmwiO2E6MDp7fXM6NToiZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo4OiJwYXNzd29yZCI7czo4OiJwYXNzd29yZCI7czozODoibG9naW5fODJlNWQyYzU2YmRkMDgxMTMxOGYwY2YwNzhiNzhiZmMiO3M6MjoiNDMiO3M6OToiX3NmMl9tZXRhIjthOjM6e3M6MToidSI7aToxNDI4NTUyMzc1O3M6MToiYyI7aToxNDI4NTUxODg5O3M6MToibCI7czoxOiIwIjt9fQ==');
     // return $user = Sentry::getUser();
     // return base64_decode(base64_decode('TVE9PQ=='));
     DB::connection()->getPdo();
     DB::getPdo();
     return base64_encode('wenyi_2');
     return Session::all();
     //        new MessageBag;
     // Session::get(name, default)
     // return Cookie::get(key, default);
     $encrypted1 = Crypt::encrypt('1');
     $encrypted2 = Crypt::encrypt(1);
     $encrypted3 = Crypt::encrypt(1);
     echo $encrypted1 . PHP_EOL;
     echo $encrypted2 . PHP_EOL;
     echo $encrypted3 . PHP_EOL;
     $decrypted1 = Crypt::decrypt($encrypted1);
     $decrypted2 = Crypt::decrypt($encrypted2);
     $decrypted3 = Crypt::decrypt($encrypted3);
     var_dump($decrypted1);
     var_dump($decrypted2);
     var_dump($decrypted3);
     // Response::make()
     //
     // $orders = MainOrder::all();
     // $suborder = new SubOrder;
     // return $suborder->get();
     // return $suborder->sum();
     // return $orders;
     // $main = new MainOrder();
     // dd($main->getNameSpace);
     // $count = Input::get('count');
     // if( empty($count) ) {
     // 	$count = 3;
     // }
     // $count = 3;
     // $goods = Goods::where('wy_goods_id', '<=', $count)->get(array('wy_goods_id', 'wy_goods_name',
     // 	'wy_goods_img','wy_goods_sale_price','wy_sale_count','wy_brief'));
     // $goods = $goods->toArray();
     // $orders = MainOrder::where('wy_order_state', 1)->groupBy('wy_shop_id')->get(array('wy_shop_id','wy_order_number', 'wy_recv_name',
     // 	'wy_recv_phone','wy_recv_addr','wy_actual_money','wy_book_time','wy_order_state'));
     // var_dump($orders);
     // unset($goods[0]['wy_goods_id']);
     // return $orders;
     //推送前台的数据最好携带uid信息,可以直接推送
     // $sendMsg = array(
     // 	"func_no" => 700003,
     // 	"data" => array(
     // 		array(
     // 			"main_order_id" => 1,
     // 			"shop_id" => 1
     // 		)
     // 	)
     // );
     // var_dump($sendMsg);
     // $jsonData = 'content=' . json_encode($sendMsg);
     // var_dump($jsonData);
     // $url = "http://192.168.140.128:9501/push";
     // return $this->post($url, $jsonData);
 }