Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
onestartup-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Angel Martin
onestartup-shop
Commits
2b3ac039
Commit
2b3ac039
authored
May 29, 2018
by
Angel MAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
seguimiento de ordenes
parent
b0d9029a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
237 additions
and
80 deletions
+237
-80
AdminProductController.php
src/controllers/AdminProductController.php
+14
-0
2018_05_29_211921_create_order_trackings_table.php
...ations/2018_05_29_211921_create_order_trackings_table.php
+39
-0
OrderTracking.php
src/models/OrderTracking.php
+26
-0
SaleShop.php
src/models/SaleShop.php
+5
-0
routes.php
src/routes.php
+4
-0
orden.blade.php
src/views/clients/orden.blade.php
+149
-80
No files found.
src/controllers/AdminProductController.php
View file @
2b3ac039
...
...
@@ -14,6 +14,7 @@ use Onestartup\Shop\Model\ProductShopInfo as ProductInfo;
use
Onestartup\Shop\DataTables\ClientDataTable
;
use
Onestartup\Shop\DataTables\OrderDataTable
;
use
Onestartup\Shop\Model\SaleShop
as
Sale
;
use
Onestartup\Shop\Model\OrderTracking
as
Tracking
;
class
AdminProductController
extends
Controller
...
...
@@ -312,4 +313,17 @@ class AdminProductController extends Controller
return
redirect
()
->
back
()
->
with
(
'message_success'
,
'Estatus actualizado correctamente'
);
}
public
function
trackingStore
(
Request
$request
,
$id
)
{
$sale
=
Sale
::
find
(
$id
);
$comment
=
new
Tracking
(
$request
->
all
());
$comment
->
user_id
=
\Auth
::
user
()
->
id
;
$sale
->
tracking_sales
()
->
save
(
$comment
);
return
redirect
()
->
back
()
->
with
(
'message_success'
,
'Información agregada correctamente'
);
}
}
src/migrations/2018_05_29_211921_create_order_trackings_table.php
0 → 100644
View file @
2b3ac039
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
CreateOrderTrackingsTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'order_trackings'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
string
(
'type'
,
355
);
$table
->
string
(
'detail'
,
555
);
$table
->
integer
(
'sale_id'
)
->
unsigned
();
$table
->
foreign
(
'sale_id'
)
->
references
(
'id'
)
->
on
(
'sale_shops'
);
$table
->
integer
(
'user_id'
)
->
unsigned
();
$table
->
foreign
(
'user_id'
)
->
references
(
'id'
)
->
on
(
'users'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'order_trackings'
);
}
}
src/models/OrderTracking.php
0 → 100644
View file @
2b3ac039
<?php
namespace
Onestartup\Shop\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
OrderTracking
extends
Model
{
protected
$table
=
'order_trackings'
;
protected
$fillable
=
[
'type'
,
'detail'
,
'sale_id'
,
'user_id'
];
public
function
user
()
{
return
$this
->
belongsTo
(
'App\User'
,
'user_id'
);
}
public
function
sale
()
{
return
$this
->
belongsTo
(
'Onestartup\Shop\Model\SaleShop'
,
'sale_id'
);
}
}
src/models/SaleShop.php
View file @
2b3ac039
...
...
@@ -19,4 +19,9 @@ class SaleShop extends Model
{
return
$this
->
hasMany
(
'Onestartup\Shop\Model\DetailShop'
,
'sale_id'
);
}
public
function
tracking_sales
()
{
return
$this
->
hasMany
(
'Onestartup\Shop\Model\OrderTracking'
,
'sale_id'
);
}
}
src/routes.php
View file @
2b3ac039
...
...
@@ -61,6 +61,10 @@ Route::group(['middleware' => ['web', 'auth', 'is_admin']], function(){
'Onestartup\Shop\Controller\AdminProductController@updateStatusSale'
)
->
name
(
'admin-shop-client.statussale'
);
Route
::
post
(
'admin/shop/client/sale/{id}/tracking'
,
'Onestartup\Shop\Controller\AdminProductController@trackingStore'
)
->
name
(
'admin-shop-client.trackingStore'
);
});
...
...
src/views/clients/orden.blade.php
View file @
2b3ac039
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment