コード例 #1
0
ファイル: StatsController.php プロジェクト: ItsRD/playplastic
 public function getStats()
 {
     $province = Province::all();
     $array = [];
     foreach ($province as $p) {
         $array[] = [$p->name, $p->points()];
     }
     return json_encode($array);
 }
コード例 #2
0
 private function _users()
 {
     $provinces = Province::all();
     foreach ($provinces as $p) {
         $faker = \Faker\Factory::create();
         $user = new User();
         $user->name = $faker->name;
         $user->province_id = $p->id;
         $user->email = $faker->email;
         $user->password = Hash::make('123456');
         $user->save();
         $license = License::where('used', 0)->first();
         $license->used = 1;
         $license->save();
         $license->user()->attach($user);
         $score = new Score();
         $score->score = rand(100, 3500);
         $score->license = $license->license;
         $score->save();
     }
 }
コード例 #3
0
  public function getReceiverinfo (Request $request)
  {
    $user = Auth::user();

    $receiverInfoSet = ReceiverInfo::where('uid', '=', $user->id)

      ->where('active', '=', '1')

      ->orderBy('last_used', 'desc')

      ->orderBy('created_at', 'desc')

      ->get();

    $provinceSet = Province::all();      

    $provinces = array();

    foreach ($provinceSet as $province) {
    
      array_push($provinces, $province);
    
    }

    $cities = City::all();

    $districts = array();

    foreach ($cities as $city) {
    
      $district = District::where('city_code', '=', $city->code) 

        ->where('active', '=', '1')

        ->first();

      if ($district) {

        array_push($districts, $district);
    
      }

    }

    $receiverInfos = array();

    foreach ($receiverInfoSet as $receiverInfo) {
    
      array_push($receiverInfos, $receiverInfo);
    
    }

    $data = [
    
      'receiverInfos' => $receiverInfos,

      'provinces' => $provinces,

      'cities' => $cities,

      'districts' => $districts,

      'receiverActive' => true,

      'wTitle' => '个人中心 - 收货人信息'
    
    ];

    return view('profile/receiver_info', $data);
  
  }
コード例 #4
0
ファイル: APIController.php プロジェクト: timdonat/ketangkap
 public function getProvince($id = NULL)
 {
     return $id == NULL ? Province::all() : Province::find($id);
 }
コード例 #5
0
ファイル: StatsController.php プロジェクト: ItsRD/playplastic
 public function index()
 {
     $title = 'Statistieken';
     $province = Province::all();
     return view('stats.index', compact('title', 'province'));
 }
コード例 #6
0
  public function getProvince (Request $request)
  {
    $provinces = Province::all(); 
  
    $html = $this->provinceList($provinces);

    return $this->successResponse('res', $html);
  
  }
コード例 #7
0
ファイル: HomeController.php プロジェクト: ItsRD/playplastic
 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     $title = 'Homepagina';
     $provinces = Province::all();
     return view('home.index', compact('title', 'provinces'));
 }