Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
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
chenchuanwen
my-yaf-project
Commits
73b8b827
Commit
73b8b827
authored
Jan 11, 2019
by
chenchuanwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
realeaseInstance
parent
b08f2864
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
Index.php
application/controllers/Index.php
+4
-1
OrderService.php
application/models/Business/Order/OrderService.php
+5
-1
No files found.
application/controllers/Index.php
View file @
73b8b827
...
@@ -114,12 +114,15 @@ class IndexController extends \Our\Controller_Abstract {
...
@@ -114,12 +114,15 @@ class IndexController extends \Our\Controller_Abstract {
public
function
testRelease
(){
public
function
testRelease
(){
$obj
=
\Business\Order\OrderServiceModel
::
getInstance
();
$obj
=
\Business\Order\OrderServiceModel
::
getInstance
();
$obj
->
order
=
'abc'
;
$obj
->
order
=
'abc'
;
//\Business\Order\OrderServiceModel::realeaseInstance();
}
}
public
function
indexAction
()
{
public
function
indexAction
()
{
$this
->
testRelease
();
$this
->
testRelease
();
$obj
=
\Business\Order\OrderServiceModel
::
getInstance
();
$obj
=
\Business\Order\OrderServiceModel
::
getInstance
();
echo
$obj
->
order
;
exit
;
echo
$obj
->
order
;
exit
;
$getKey
=
$_GET
[
'key'
];
$getKey
=
$_GET
[
'key'
];
if
(
$getKey
!=
'~!@#$`1234qwert'
){
if
(
$getKey
!=
'~!@#$`1234qwert'
){
throw
new
Exception
(
'非法'
,
-
1111
);
throw
new
Exception
(
'非法'
,
-
1111
);
...
...
application/models/Business/Order/OrderService.php
View file @
73b8b827
...
@@ -1790,7 +1790,11 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -1790,7 +1790,11 @@ class OrderServiceModel extends \Business\AbstractModel
* @var \DAO\UserModel
* @var \DAO\UserModel
*/
*/
private
static
$_instance
=
null
;
private
static
$_instance
=
null
;
public
static
function
realeaseInstance
(){
if
(
!
empty
(
self
::
$_instance
)){
self
::
$_instance
=
null
;
}
}
/**
/**
* 单例模式获取类实例
* 单例模式获取类实例
*
*
...
...
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