@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | $this->auth = $auth; |
13 | 13 | } |
14 | 14 | |
15 | - public function handle($request, Closure $next) |
|
16 | - { |
|
15 | + public function handle($request, Closure $next) |
|
16 | + { |
|
17 | 17 | if ($this->auth->guest() || (session('role')!=='USER' && session('role')!=='MNGR' && session('role')!=='ADMN') ) |
18 | 18 | { |
19 | 19 | if ($request->ajax()) |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
29 | - return $next($request); |
|
30 | - } |
|
29 | + return $next($request); |
|
30 | + } |
|
31 | 31 | |
32 | 32 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | public function handle($request, Closure $next) |
16 | 16 | { |
17 | - if ($this->auth->guest() || (session('role')!=='USER' && session('role')!=='MNGR' && session('role')!=='ADMN') ) |
|
17 | + if ($this->auth->guest() || (session('role') !== 'USER' && session('role') !== 'MNGR' && session('role') !== 'ADMN')) |
|
18 | 18 | { |
19 | 19 | if ($request->ajax()) |
20 | 20 | { |
@@ -19,8 +19,7 @@ |
||
19 | 19 | if ($request->ajax()) |
20 | 20 | { |
21 | 21 | return response('Unauthorized.', 401); |
22 | - } |
|
23 | - else |
|
22 | + } else |
|
24 | 23 | { |
25 | 24 | return redirect()->guest('/'); |
26 | 25 | } |
@@ -5,24 +5,24 @@ |
||
5 | 5 | |
6 | 6 | class VerifyCsrfToken extends BaseVerifier { |
7 | 7 | |
8 | - private $openRoutes = []; |
|
8 | + private $openRoutes = []; |
|
9 | 9 | |
10 | - /** |
|
11 | - * Handle an incoming request. |
|
12 | - * |
|
13 | - * @param \Illuminate\Http\Request $request |
|
14 | - * @param \Closure $next |
|
15 | - * @return mixed |
|
16 | - */ |
|
17 | - public function handle($request, Closure $next) |
|
18 | - { |
|
19 | - // Disable CSRF control for xHttp Requests |
|
20 | - if($request->isXmlHttpRequest()) |
|
21 | - { |
|
22 | - return $next($request); |
|
23 | - } |
|
10 | + /** |
|
11 | + * Handle an incoming request. |
|
12 | + * |
|
13 | + * @param \Illuminate\Http\Request $request |
|
14 | + * @param \Closure $next |
|
15 | + * @return mixed |
|
16 | + */ |
|
17 | + public function handle($request, Closure $next) |
|
18 | + { |
|
19 | + // Disable CSRF control for xHttp Requests |
|
20 | + if($request->isXmlHttpRequest()) |
|
21 | + { |
|
22 | + return $next($request); |
|
23 | + } |
|
24 | 24 | |
25 | - return parent::handle($request, $next); |
|
26 | - } |
|
25 | + return parent::handle($request, $next); |
|
26 | + } |
|
27 | 27 | |
28 | 28 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | public function handle($request, Closure $next) |
18 | 18 | { |
19 | 19 | // Disable CSRF control for xHttp Requests |
20 | - if($request->isXmlHttpRequest()) |
|
20 | + if ($request->isXmlHttpRequest()) |
|
21 | 21 | { |
22 | 22 | return $next($request); |
23 | 23 | } |
@@ -4,6 +4,6 @@ |
||
4 | 4 | |
5 | 5 | abstract class Request extends FormRequest { |
6 | 6 | |
7 | - // |
|
7 | + // |
|
8 | 8 | |
9 | 9 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | Route::group(['prefix'=>'app', 'middleware'=>'user'], function(){ |
42 | 42 | |
43 | - // POS MODULE |
|
43 | + // POS MODULE |
|
44 | 44 | |
45 | 45 | Route::get('/', 'BarController@app'); |
46 | 46 | |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | |
49 | 49 | // ACCOUNT MODULE |
50 | 50 | |
51 | - Route::get('account', 'AccountController@index'); |
|
51 | + Route::get('account', 'AccountController@index'); |
|
52 | 52 | |
53 | 53 | Route::post('account', 'AccountController@saveProfile'); |
54 | 54 | |
55 | - Route::get('logout', 'LoginController@logout'); |
|
55 | + Route::get('logout', 'LoginController@logout'); |
|
56 | 56 | |
57 | 57 | }); |
58 | 58 | |
@@ -60,33 +60,33 @@ discard block |
||
60 | 60 | |
61 | 61 | Route::group(['prefix'=>'app', 'middleware'=>'manager'], function(){ |
62 | 62 | |
63 | - // STOCK MODULE |
|
63 | + // STOCK MODULE |
|
64 | 64 | |
65 | 65 | Route::get('stock', 'StockController@dashboard'); |
66 | 66 | |
67 | - Route::resource('stock/category', 'CategoryController', ['except' => ['create','edit']]); |
|
67 | + Route::resource('stock/category', 'CategoryController', ['except' => ['create','edit']]); |
|
68 | 68 | |
69 | - Route::resource('stock/product', 'ProductController', ['except' => ['create','edit']]); |
|
69 | + Route::resource('stock/product', 'ProductController', ['except' => ['create','edit']]); |
|
70 | 70 | |
71 | - // CASH MODULE |
|
71 | + // CASH MODULE |
|
72 | 72 | |
73 | - Route::get('cash/{snapshot?}', 'CashController@dashboard')->where('snapshot', '[0-9]+'); |
|
73 | + Route::get('cash/{snapshot?}', 'CashController@dashboard')->where('snapshot', '[0-9]+'); |
|
74 | 74 | |
75 | - Route::get('cash/register-operation', 'CashController@operationForm'); |
|
75 | + Route::get('cash/register-operation', 'CashController@operationForm'); |
|
76 | 76 | |
77 | - Route::post('cash/register-operation', 'CashController@registerOperation'); |
|
77 | + Route::post('cash/register-operation', 'CashController@registerOperation'); |
|
78 | 78 | |
79 | - Route::get('cash/new-snapshot', 'CashController@snapshotForm'); |
|
79 | + Route::get('cash/new-snapshot', 'CashController@snapshotForm'); |
|
80 | 80 | |
81 | - Route::post('cash/new-snapshot', 'CashController@createSnapshot'); |
|
81 | + Route::post('cash/new-snapshot', 'CashController@createSnapshot'); |
|
82 | 82 | |
83 | 83 | Route::get('cash/remove/{id}', 'CashController@removeDetail')->where('id', '[0-9]+'); |
84 | 84 | |
85 | - Route::get('cash/history', 'CashController@showHistory'); |
|
85 | + Route::get('cash/history', 'CashController@showHistory'); |
|
86 | 86 | |
87 | - // STATS MODULE |
|
87 | + // STATS MODULE |
|
88 | 88 | |
89 | - Route::get('stats/{interval?}', 'StatsController@dashboard')->where('interval', '[0-9]+[hd]'); |
|
89 | + Route::get('stats/{interval?}', 'StatsController@dashboard')->where('interval', '[0-9]+[hd]'); |
|
90 | 90 | |
91 | 91 | }); |
92 | 92 | |
@@ -96,24 +96,24 @@ discard block |
||
96 | 96 | |
97 | 97 | // USERS MODULE |
98 | 98 | |
99 | - Route::get('users', 'UsersController@getActiveUsers'); |
|
99 | + Route::get('users', 'UsersController@getActiveUsers'); |
|
100 | 100 | |
101 | 101 | Route::get('users/connections/{id}', 'UsersController@showConnections'); |
102 | 102 | |
103 | - Route::get('users/disabled', 'UsersController@getDisabledUsers'); |
|
103 | + Route::get('users/disabled', 'UsersController@getDisabledUsers'); |
|
104 | 104 | |
105 | - Route::get('users/register', 'UsersController@getRegisterForm'); |
|
105 | + Route::get('users/register', 'UsersController@getRegisterForm'); |
|
106 | 106 | |
107 | - Route::post('users/register', 'UsersController@registerNewUser'); |
|
107 | + Route::post('users/register', 'UsersController@registerNewUser'); |
|
108 | 108 | |
109 | - Route::get('users/change-status/{id}', 'UsersController@changeAccountStatus')->where('id', '[0-9]+');; |
|
109 | + Route::get('users/change-status/{id}', 'UsersController@changeAccountStatus')->where('id', '[0-9]+');; |
|
110 | 110 | |
111 | - Route::get('users/change-role/{id}', 'UsersController@changeAccountRole')->where('id', '[0-9]+');; |
|
111 | + Route::get('users/change-role/{id}', 'UsersController@changeAccountRole')->where('id', '[0-9]+');; |
|
112 | 112 | |
113 | - Route::get('users/delete/{id}', 'UsersController@deleteUser')->where('id', '[0-9]+');; |
|
113 | + Route::get('users/delete/{id}', 'UsersController@deleteUser')->where('id', '[0-9]+');; |
|
114 | 114 | |
115 | 115 | // SETTINGS MODULE |
116 | 116 | |
117 | - Route::get('settings', 'SettingsController@index'); |
|
117 | + Route::get('settings', 'SettingsController@index'); |
|
118 | 118 | |
119 | 119 | }); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | // INSTALLATION ROUTES |
4 | 4 | |
5 | -Route::group(['prefix'=>'install', 'middleware'=>'installed'], function(){ |
|
5 | +Route::group(['prefix'=>'install', 'middleware'=>'installed'], function() { |
|
6 | 6 | |
7 | 7 | Route::get('/', 'InstallController@displayWelcome'); |
8 | 8 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | // PUBLIC ROUTES |
30 | 30 | |
31 | -Route::group(['middleware'=>'guest'], function(){ |
|
31 | +Route::group(['middleware'=>'guest'], function() { |
|
32 | 32 | |
33 | 33 | Route::get('/', 'LoginController@getLoginForm'); |
34 | 34 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | // USER ROUTES |
40 | 40 | |
41 | -Route::group(['prefix'=>'app', 'middleware'=>'user'], function(){ |
|
41 | +Route::group(['prefix'=>'app', 'middleware'=>'user'], function() { |
|
42 | 42 | |
43 | 43 | // POS MODULE |
44 | 44 | |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | // MANAGER ROUTES |
60 | 60 | |
61 | -Route::group(['prefix'=>'app', 'middleware'=>'manager'], function(){ |
|
61 | +Route::group(['prefix'=>'app', 'middleware'=>'manager'], function() { |
|
62 | 62 | |
63 | 63 | // STOCK MODULE |
64 | 64 | |
65 | 65 | Route::get('stock', 'StockController@dashboard'); |
66 | 66 | |
67 | - Route::resource('stock/category', 'CategoryController', ['except' => ['create','edit']]); |
|
67 | + Route::resource('stock/category', 'CategoryController', ['except' => ['create', 'edit']]); |
|
68 | 68 | |
69 | - Route::resource('stock/product', 'ProductController', ['except' => ['create','edit']]); |
|
69 | + Route::resource('stock/product', 'ProductController', ['except' => ['create', 'edit']]); |
|
70 | 70 | |
71 | 71 | // CASH MODULE |
72 | 72 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | // ADMIN ROUTES |
94 | 94 | |
95 | -Route::group(['prefix'=>'app', 'middleware'=>'administrator'], function(){ |
|
95 | +Route::group(['prefix'=>'app', 'middleware'=>'administrator'], function() { |
|
96 | 96 | |
97 | 97 | // USERS MODULE |
98 | 98 | |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | |
107 | 107 | Route::post('users/register', 'UsersController@registerNewUser'); |
108 | 108 | |
109 | - Route::get('users/change-status/{id}', 'UsersController@changeAccountStatus')->where('id', '[0-9]+');; |
|
109 | + Route::get('users/change-status/{id}', 'UsersController@changeAccountStatus')->where('id', '[0-9]+'); ; |
|
110 | 110 | |
111 | - Route::get('users/change-role/{id}', 'UsersController@changeAccountRole')->where('id', '[0-9]+');; |
|
111 | + Route::get('users/change-role/{id}', 'UsersController@changeAccountRole')->where('id', '[0-9]+'); ; |
|
112 | 112 | |
113 | - Route::get('users/delete/{id}', 'UsersController@deleteUser')->where('id', '[0-9]+');; |
|
113 | + Route::get('users/delete/{id}', 'UsersController@deleteUser')->where('id', '[0-9]+'); ; |
|
114 | 114 | |
115 | 115 | // SETTINGS MODULE |
116 | 116 |
@@ -4,22 +4,22 @@ |
||
4 | 4 | |
5 | 5 | class CashSnapshots extends Model { |
6 | 6 | |
7 | - protected $table = 'cash_snapshots'; |
|
8 | - public $primaryKey = 'cs_id'; |
|
9 | - public $timestamps = false; |
|
7 | + protected $table = 'cash_snapshots'; |
|
8 | + public $primaryKey = 'cs_id'; |
|
9 | + public $timestamps = false; |
|
10 | 10 | |
11 | - public static $validationRules = [ 'title' => 'required|name', |
|
12 | - 'description' => '', |
|
13 | - 'amount' => 'required|numeric|between:0,9999' ]; |
|
11 | + public static $validationRules = [ 'title' => 'required|name', |
|
12 | + 'description' => '', |
|
13 | + 'amount' => 'required|numeric|between:0,9999' ]; |
|
14 | 14 | |
15 | - public function details() |
|
16 | - { |
|
17 | - return $this->hasMany('App\Models\SnapshotDetails','cs_id'); |
|
18 | - } |
|
15 | + public function details() |
|
16 | + { |
|
17 | + return $this->hasMany('App\Models\SnapshotDetails','cs_id'); |
|
18 | + } |
|
19 | 19 | |
20 | - public function scopeWithUsers($query) |
|
21 | - { |
|
22 | - $query->join('users', 'users.user_id', 'cash_snapshots.user_id'); |
|
23 | - } |
|
20 | + public function scopeWithUsers($query) |
|
21 | + { |
|
22 | + $query->join('users', 'users.user_id', 'cash_snapshots.user_id'); |
|
23 | + } |
|
24 | 24 | |
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -8,13 +8,13 @@ |
||
8 | 8 | public $primaryKey = 'cs_id'; |
9 | 9 | public $timestamps = false; |
10 | 10 | |
11 | - public static $validationRules = [ 'title' => 'required|name', |
|
11 | + public static $validationRules = ['title' => 'required|name', |
|
12 | 12 | 'description' => '', |
13 | - 'amount' => 'required|numeric|between:0,9999' ]; |
|
13 | + 'amount' => 'required|numeric|between:0,9999']; |
|
14 | 14 | |
15 | 15 | public function details() |
16 | 16 | { |
17 | - return $this->hasMany('App\Models\SnapshotDetails','cs_id'); |
|
17 | + return $this->hasMany('App\Models\SnapshotDetails', 'cs_id'); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function scopeWithUsers($query) |
@@ -7,56 +7,56 @@ |
||
7 | 7 | |
8 | 8 | class Categories extends Model { |
9 | 9 | |
10 | - use SoftDeletes; |
|
10 | + use SoftDeletes; |
|
11 | 11 | |
12 | - protected $table = 'categories'; |
|
13 | - public $timestamps = true; |
|
14 | - protected $dates = ['deleted_at']; |
|
12 | + protected $table = 'categories'; |
|
13 | + public $timestamps = true; |
|
14 | + protected $dates = ['deleted_at']; |
|
15 | 15 | |
16 | - protected $guarded = ['category_id']; |
|
16 | + protected $guarded = ['category_id']; |
|
17 | 17 | |
18 | - public function getKeyName(){ |
|
18 | + public function getKeyName(){ |
|
19 | 19 | |
20 | 20 | return 'category_id'; |
21 | 21 | } |
22 | 22 | |
23 | 23 | public static function allAPI() { |
24 | 24 | |
25 | - $query = 'SELECT c.category_id as "id", c.category_title as "title", |
|
25 | + $query = 'SELECT c.category_id as "id", c.category_title as "title", |
|
26 | 26 | c.description, c.is_active as "active", c.created_at as "created" |
27 | 27 | FROM categories c |
28 | 28 | WHERE c.group_id = ? |
29 | 29 | AND c.deleted_at IS NULL'; |
30 | 30 | |
31 | - return DB::select($query, [ Session::get('groupID') ]); |
|
31 | + return DB::select($query, [ Session::get('groupID') ]); |
|
32 | 32 | } |
33 | 33 | |
34 | - /** |
|
35 | - * Selects all the categories from the current group |
|
36 | - * |
|
37 | - * Allows to extend the query (scope) to only selects the categories from the group |
|
38 | - * where the user is connected. |
|
39 | - * @example Categories::group(); |
|
40 | - * |
|
41 | - * @param Object [Laravel] |
|
42 | - */ |
|
43 | - public function scopeFromGroup($query) { |
|
44 | - |
|
45 | - return $query->where('group_id', Session::get('groupID') ); |
|
46 | - } |
|
47 | - |
|
48 | - /** |
|
49 | - * Selects all the products from one category |
|
50 | - * |
|
51 | - * Easily fetch all the products that belongs to a category. Watch out, |
|
52 | - * only works for ONE category. |
|
53 | - * @example Categories::find(1)->products; |
|
54 | - * |
|
55 | - * @return Object [Laravel] |
|
56 | - */ |
|
57 | - public function products() { |
|
58 | - |
|
59 | - return $this->hasMany('App\Models\Products', 'category_id', 'category_id'); |
|
60 | - } |
|
34 | + /** |
|
35 | + * Selects all the categories from the current group |
|
36 | + * |
|
37 | + * Allows to extend the query (scope) to only selects the categories from the group |
|
38 | + * where the user is connected. |
|
39 | + * @example Categories::group(); |
|
40 | + * |
|
41 | + * @param Object [Laravel] |
|
42 | + */ |
|
43 | + public function scopeFromGroup($query) { |
|
44 | + |
|
45 | + return $query->where('group_id', Session::get('groupID') ); |
|
46 | + } |
|
47 | + |
|
48 | + /** |
|
49 | + * Selects all the products from one category |
|
50 | + * |
|
51 | + * Easily fetch all the products that belongs to a category. Watch out, |
|
52 | + * only works for ONE category. |
|
53 | + * @example Categories::find(1)->products; |
|
54 | + * |
|
55 | + * @return Object [Laravel] |
|
56 | + */ |
|
57 | + public function products() { |
|
58 | + |
|
59 | + return $this->hasMany('App\Models\Products', 'category_id', 'category_id'); |
|
60 | + } |
|
61 | 61 | |
62 | 62 | } |
63 | 63 | \ No newline at end of file |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | protected $guarded = ['category_id']; |
17 | 17 | |
18 | - public function getKeyName(){ |
|
18 | + public function getKeyName() { |
|
19 | 19 | |
20 | 20 | return 'category_id'; |
21 | 21 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | WHERE c.group_id = ? |
29 | 29 | AND c.deleted_at IS NULL'; |
30 | 30 | |
31 | - return DB::select($query, [ Session::get('groupID') ]); |
|
31 | + return DB::select($query, [Session::get('groupID')]); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function scopeFromGroup($query) { |
44 | 44 | |
45 | - return $query->where('group_id', Session::get('groupID') ); |
|
45 | + return $query->where('group_id', Session::get('groupID')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | class ConnectHistory extends Model { |
6 | 6 | |
7 | - protected $table = 'connect_history'; |
|
7 | + protected $table = 'connect_history'; |
|
8 | 8 | |
9 | - public $timestamps = false; |
|
9 | + public $timestamps = false; |
|
10 | 10 | |
11 | 11 | } |
12 | 12 | \ No newline at end of file |
@@ -4,13 +4,13 @@ |
||
4 | 4 | |
5 | 5 | class Groups extends Model { |
6 | 6 | |
7 | - protected $table = 'groups'; |
|
7 | + protected $table = 'groups'; |
|
8 | 8 | |
9 | - public $timestamps = false; |
|
9 | + public $timestamps = false; |
|
10 | 10 | |
11 | - protected $guarded = ['group_id']; |
|
11 | + protected $guarded = ['group_id']; |
|
12 | 12 | |
13 | - public function getKeyName(){ |
|
13 | + public function getKeyName(){ |
|
14 | 14 | |
15 | 15 | return 'group_id'; |
16 | 16 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | protected $guarded = ['group_id']; |
12 | 12 | |
13 | - public function getKeyName(){ |
|
13 | + public function getKeyName() { |
|
14 | 14 | |
15 | 15 | return 'group_id'; |
16 | 16 | } |
@@ -6,50 +6,50 @@ |
||
6 | 6 | |
7 | 7 | class Products extends Model { |
8 | 8 | |
9 | - use SoftDeletes; |
|
9 | + use SoftDeletes; |
|
10 | 10 | |
11 | - protected $table = 'products'; |
|
12 | - public $timestamps = true; |
|
13 | - protected $dates = ['deleted_at']; |
|
14 | - public $primaryKey = 'product_id'; |
|
11 | + protected $table = 'products'; |
|
12 | + public $timestamps = true; |
|
13 | + protected $dates = ['deleted_at']; |
|
14 | + public $primaryKey = 'product_id'; |
|
15 | 15 | |
16 | - public static $validationRules = [ |
|
16 | + public static $validationRules = [ |
|
17 | 17 | |
18 | - 'category' => 'required|integer|min:0', |
|
19 | - 'name' => 'required|name', |
|
20 | - 'description' => 'max:250', |
|
21 | - 'price' => 'required|numeric|min:0', |
|
22 | - 'quantity' => 'required|integer|min:0' |
|
23 | - ]; |
|
18 | + 'category' => 'required|integer|min:0', |
|
19 | + 'name' => 'required|name', |
|
20 | + 'description' => 'max:250', |
|
21 | + 'price' => 'required|numeric|min:0', |
|
22 | + 'quantity' => 'required|integer|min:0' |
|
23 | + ]; |
|
24 | 24 | |
25 | 25 | public function category() { |
26 | 26 | |
27 | - return $this->belongsTo('Categories', 'category_id', 'category_id'); |
|
27 | + return $this->belongsTo('Categories', 'category_id', 'category_id'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function scopeGroup($query, $groupID) { |
31 | 31 | |
32 | - $query->select('products.*') |
|
33 | - ->join('categories', 'categories.category_id', '=', 'products.category_id') |
|
34 | - ->where('group_id', $groupID); |
|
32 | + $query->select('products.*') |
|
33 | + ->join('categories', 'categories.category_id', '=', 'products.category_id') |
|
34 | + ->where('group_id', $groupID); |
|
35 | 35 | } |
36 | 36 | |
37 | - // Still used by the App Component. |
|
38 | - public static function getSpecificExtended($id) { |
|
37 | + // Still used by the App Component. |
|
38 | + public static function getSpecificExtended($id) { |
|
39 | 39 | |
40 | - $query = 'SELECT p.* |
|
40 | + $query = 'SELECT p.* |
|
41 | 41 | FROM products p |
42 | 42 | INNER JOIN categories c ON p.category_id = c.category_id |
43 | 43 | WHERE c.category_id = p.category_id |
44 | 44 | AND c.group_id = ? |
45 | 45 | AND p.product_id = ?'; |
46 | 46 | |
47 | - $products = DB::select($query, [ Session::get('groupID'), $id ]); |
|
47 | + $products = DB::select($query, [ Session::get('groupID'), $id ]); |
|
48 | 48 | |
49 | - if( count($products) == 0 ) |
|
50 | - return null; |
|
49 | + if( count($products) == 0 ) |
|
50 | + return null; |
|
51 | 51 | |
52 | - return $products[0]; |
|
53 | - } |
|
52 | + return $products[0]; |
|
53 | + } |
|
54 | 54 | |
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -44,9 +44,9 @@ |
||
44 | 44 | AND c.group_id = ? |
45 | 45 | AND p.product_id = ?'; |
46 | 46 | |
47 | - $products = DB::select($query, [ Session::get('groupID'), $id ]); |
|
47 | + $products = DB::select($query, [Session::get('groupID'), $id]); |
|
48 | 48 | |
49 | - if( count($products) == 0 ) |
|
49 | + if (count($products) == 0) |
|
50 | 50 | return null; |
51 | 51 | |
52 | 52 | return $products[0]; |
@@ -46,8 +46,9 @@ |
||
46 | 46 | |
47 | 47 | $products = DB::select($query, [ Session::get('groupID'), $id ]); |
48 | 48 | |
49 | - if( count($products) == 0 ) |
|
50 | - return null; |
|
49 | + if( count($products) == 0 ) { |
|
50 | + return null; |
|
51 | + } |
|
51 | 52 | |
52 | 53 | return $products[0]; |
53 | 54 | } |