Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
0af3c237
Commit
0af3c237
authored
Sep 13, 2021
by
mengweifu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:ota manage
parent
2721c9fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
OtaValidate.php
application/library/Validate/OtaValidate.php
+6
-6
Ota.php
application/modules/Goods/controllers/Ota.php
+2
-1
OtaService.php
application/services/goods/OtaService.php
+2
-2
No files found.
application/library/Validate/OtaValidate.php
View file @
0af3c237
...
...
@@ -14,10 +14,10 @@ class OtaValidate extends \Validate\BaseValidate
protected
$rule
=
[
'ota_name'
=>
'require'
,
'ota_id'
=>
'require'
,
'address'
=>
'require'
,
'location'
=>
'require'
,
'longitude'
=>
'require'
,
'latitude'
=>
'require'
,
//
'address' => 'require',
//
'location' => 'require',
//
'longitude' => 'require',
//
'latitude' => 'require',
'offset'
=>
'egt:0'
,
'limit'
=>
'elt:100'
,
];
...
...
@@ -42,7 +42,7 @@ class OtaValidate extends \Validate\BaseValidate
public
function
sceneAdd
()
{
return
$this
->
only
([
'ota_name'
,
'address'
,
'longitude'
,
'latitude'
,
'location'
]);
return
$this
->
only
([
'ota_name'
]);
}
public
function
sceneDelete
()
{
...
...
@@ -56,7 +56,7 @@ class OtaValidate extends \Validate\BaseValidate
public
function
sceneUpdate
()
{
return
$this
->
only
([
'ota_id'
,
'ota_name'
,
'address'
,
'longitude'
,
'latitude'
,
'location'
]);
return
$this
->
only
([
'ota_id'
,
'ota_name'
]);
}
public
function
sceneListByIds
()
{
...
...
application/modules/Goods/controllers/Ota.php
View file @
0af3c237
...
...
@@ -24,9 +24,10 @@ class OtaController extends Base
$printerKey
=
$this
->
params
[
'printer_key'
]
??
''
;
$labelPrinterSn
=
$this
->
params
[
'label_printer_sn'
]
??
''
;
$labelPrinterKey
=
$this
->
params
[
'label_printer_key'
]
??
''
;
$isNormal
=
$this
->
params
[
'is_normal'
]
??
false
;
$offset
=
$this
->
params
[
'offset'
]
??
0
;
$limit
=
$this
->
params
[
'limit'
]
??
20
;
$res
=
OtaService
::
list
(
$name
,
$printerSn
,
$printerKey
,
$labelPrinterSn
,
$labelPrinterKey
,
$offset
,
$limit
);
$res
=
OtaService
::
list
(
$name
,
$printerSn
,
$printerKey
,
$labelPrinterSn
,
$labelPrinterKey
,
$
isNormal
,
$
offset
,
$limit
);
$this
->
success
([
'result'
=>
$res
]);
}
...
...
application/services/goods/OtaService.php
View file @
0af3c237
...
...
@@ -19,7 +19,7 @@ class OtaService
* @param int $limit
* @return \Api\PhpUtils\Mysql\MysqlBase
*/
public
static
function
list
(
$otaName
=
''
,
$printerSN
=
''
,
$printerKey
=
''
,
$labelPrinterSN
=
''
,
$labelPrinterKey
=
''
,
$offset
=
0
,
$limit
=
20
)
public
static
function
list
(
$otaName
=
''
,
$printerSN
=
''
,
$printerKey
=
''
,
$labelPrinterSN
=
''
,
$labelPrinterKey
=
''
,
$isNormal
=
false
,
$offset
=
0
,
$limit
=
20
)
{
$otaName
&&
$where
[
'ota_name'
]
=
$otaName
;
$printerSN
&&
$where
[
"printer_sn"
]
=
$printerSN
;
...
...
@@ -27,7 +27,7 @@ class OtaService
$labelPrinterSN
&&
$where
[
"label_printer_sn"
]
=
$labelPrinterSN
;
$labelPrinterKey
&&
$where
[
'label_printer_key'
]
=
$labelPrinterKey
;
//
$where['status'] = Ota::STATUS_NORMAL;
$isNormal
&&
$where
[
'status'
]
=
Ota
::
STATUS_NORMAL
;
$where
[
'ORDER'
]
=
[
'ota_id'
=>
'DESC'
];
$where
[
'LIMIT'
]
=
[
$offset
,
$limit
];
...
...
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