Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aic_duty_strategy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
yinxiaoling
aic_duty_strategy
Commits
896fdc0c
Commit
896fdc0c
authored
May 16, 2020
by
yinxiaoling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务数据编辑
parent
af921c1f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
14 deletions
+32
-14
StrategyTaskController.php
app/Http/Controllers/strategy/StrategyTaskController.php
+30
-13
StrategyTask.php
app/Models/StrategyTask.php
+1
-0
DatabaseSeeder.php
database/seeds/DatabaseSeeder.php
+1
-1
No files found.
app/Http/Controllers/strategy/StrategyTaskController.php
View file @
896fdc0c
...
...
@@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
use
App\Models\StrategyTask
;
use
Illuminate\Foundation\Validation\ValidatesRequests
;
use
App\Http\Controllers\Tool
;
use
Illuminate\Support\Facades\Validator
;
class
StrategyTaskController
extends
Controller
{
...
...
@@ -43,9 +44,9 @@ class StrategyTaskController extends Controller
});
if
(
empty
(
$pageSize
)){
$strategyInfo
=
$strategyInfo
->
get
()
->
toArray
();
$strategyInfo
=
$strategyInfo
->
orderBy
(
'call_date'
,
'desc'
)
->
get
()
->
toArray
();
}
else
{
$strategyInfo
=
$strategyInfo
->
paginate
(
$pageSize
)
->
toArray
();
$strategyInfo
=
$strategyInfo
->
orderBy
(
'call_date'
,
'desc'
)
->
paginate
(
$pageSize
)
->
toArray
();
}
$listInfo
=
[];
...
...
@@ -57,19 +58,35 @@ class StrategyTaskController extends Controller
}
public
function
show
(
$strategy_sn
){
}
public
function
update
(
Request
$request
,
$strategy_sn
)
public
function
update
(
Request
$request
,
$id
)
{
try
{
return
$this
->
successWithInfo
(
'更新成功'
);
}
catch
(
\Exception
$e
)
{
return
$this
->
errorWithInfo
(
$e
->
getMessageBag
());
$phone
=
$request
->
phone
;
$name
=
$request
->
name
;
$callTime
=
$request
->
call_time
;
$validator
=
Validator
::
make
(
$request
->
all
(),
[
'phone'
=>
'required'
,
//验证手机号格式?
'user_sn'
=>
'required'
,
'call_time'
=>
'required'
,
'name'
=>
'max:20'
]);
if
(
$validator
->
fails
())
{
return
$this
->
errorWithInfo
(
'表单验证失败'
,
401
);
}
$taskInfo
=
StrategyTask
::
find
(
$id
);
if
(
$taskInfo
->
is_created
==
1
){
return
$this
->
errorWithInfo
(
'任务已经创建不能编辑'
,
401
);
}
$taskInfo
->
phone
=
$phone
;
$taskInfo
->
name
=
$name
;
$taskInfo
->
call_time
=
$callTime
;
$taskInfo
->
save
();
return
$this
->
successWithInfo
(
'更新成功'
);
}
...
...
app/Models/StrategyTask.php
View file @
896fdc0c
...
...
@@ -10,4 +10,5 @@ class StrategyTask extends Model
protected
$table
=
'strategy_task'
;
public
$timestamps
=
false
;
//此处设置false 表示表中可以不需要created_at updated_at
}
database/seeds/DatabaseSeeder.php
View file @
896fdc0c
...
...
@@ -68,7 +68,7 @@ class DatabaseSeeder extends Seeder
$table
->
uuid
(
'strategy_sn'
)
->
comment
(
'策略sn编号'
);
//sn编号
$table
->
char
(
'name'
,
50
)
->
nullable
()
->
comment
(
'姓名'
);
$table
->
date
(
'duty_date'
)
->
nullable
()
->
comment
(
'值班日期(年月日)'
);
$table
->
date
(
'import_date'
)
->
nullable
()
->
comment
(
'导入日期(年-月-日 时:分:秒)'
);
$table
->
timestamp
(
'import_date'
)
->
nullable
()
->
comment
(
'导入日期(年-月-日 时:分:秒)'
);
$table
->
unsignedBigInteger
(
'phone'
)
->
comment
(
'手机号'
);
$table
->
char
(
'call_number'
,
50
)
->
comment
(
'主叫号码'
);
$table
->
date
(
'call_date'
)
->
comment
(
'外呼时间(年月日)'
);
...
...
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