Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
power
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
254
Issues
254
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pardeep Sahu
power
Commits
cfa878b6
Commit
cfa878b6
authored
3 years ago
by
Pardeep Sahu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sahu_new_10_12_2021' into staging
parents
3c0cdbfa
877bf8bc
Pipeline
#2152
passed with stage
in 18 seconds
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
627 additions
and
617 deletions
+627
-617
app/Http/Controllers/ApiController.php
app/Http/Controllers/ApiController.php
+3
-1
app/Http/helpers.php
app/Http/helpers.php
+11
-0
resources/views/admin/addJob.blade.php
resources/views/admin/addJob.blade.php
+3
-1
resources/views/admin/editJob.blade.php
resources/views/admin/editJob.blade.php
+610
-615
No files found.
app/Http/Controllers/ApiController.php
View file @
cfa878b6
...
...
@@ -93,10 +93,12 @@ class ApiController extends Controller
User
::
where
(
'role'
,
3
)
->
where
(
'mobile_no'
,
'='
,
$mobile_no
)
->
update
(
$data
);
if
(
!
empty
(
$matchOtp
->
dealer_id
))
{
$dealer_id
=
$matchOtp
->
dealer_id
;
$dealerPercentage
=
getDealerPercentage
(
$matchOtp
->
dealer_id
);
}
else
{
$dealer_id
=
$matchOtp
->
dealer_office
;
$dealerPercentage
=
"0"
;
}
$result
=
array
(
'user_id'
=>
$matchOtp
->
id
,
'username'
=>
$matchOtp
->
name
,
'dealer_id'
=>
$dealer_id
,
'role'
=>
$matchOtp
->
role
);
$result
=
array
(
'user_id'
=>
$matchOtp
->
id
,
'username'
=>
$matchOtp
->
name
,
'dealer_id'
=>
$dealer_id
,
'role'
=>
$matchOtp
->
role
,
'dealer_percentage'
=>
$dealerPercentage
);
$return
=
array
(
'result'
=>
$result
,
'status_code'
=>
200
);
exit
(
json_encode
(
$return
));
}
...
...
This diff is collapsed.
Click to expand it.
app/Http/helpers.php
View file @
cfa878b6
...
...
@@ -1001,4 +1001,15 @@ function getTaregtNumber($target_id)
{
$data
=
DB
::
table
(
'target_treatments'
)
->
where
(
'target_id'
,
$target_id
)
->
sum
(
'target_num'
);
return
$data
;
}
function
getDealerPercentage
(
$dealer_id
)
{
$percentage
=
DB
::
table
(
'dealer_shares'
)
->
where
(
"dealer_id"
,
$dealer_id
)
->
orderBy
(
"id"
,
"DESC"
)
->
first
()
->
share_percentage
;
if
(
!
empty
(
$percentage
))
{
$percentage
=
$percentage
;
}
else
{
$percentage
=
"0"
;
}
return
$percentage
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
resources/views/admin/addJob.blade.php
View file @
cfa878b6
...
...
@@ -666,7 +666,9 @@ if (@$advisor_id) {
var
customer
=
"
.customer
"
+
a
;
var
actualclass
=
"
.actualPrice
"
+
a
;
var
dealerPercent
=
"
.dealerPercent
"
+
a
;
var
powerShare
=
"
.powerShare
"
+
a
;
var
diff
=
"
.difference
"
+
a
;
var
diffPrice
=
$
(
diff
).
val
();
var
customerPrice
=
$
(
customer
).
val
();
...
...
@@ -679,7 +681,7 @@ if (@$advisor_id) {
// $(diff).val(isNaN(difference)? 0 : difference.toFixed(2));
$
(
actualclass
).
val
(
isNaN
(
actualP
)
?
0
:
actualP
.
toFixed
(
2
));
$
(
dealerPercent
).
val
(
isNaN
(
deal
)
?
0
:
deal
.
toFixed
(
2
));
$
(
"
.powerShare
"
+
a
).
val
((
$
(
actualclass
).
val
()
-
$
(
dealerPercent
).
val
()).
toFixed
(
2
));
$
(
powerShare
).
val
((
$
(
actualclass
).
val
()
-
$
(
dealerPercent
).
val
()).
toFixed
(
2
));
}
});
}
...
...
This diff is collapsed.
Click to expand it.
resources/views/admin/editJob.blade.php
View file @
cfa878b6
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