2015-04-16 16:11:17
天罗地网
|
删除project时,应该把project下面的task同时删除!否则数据库残留还多未标记删除的task。我自己外挂一个delete
<?php
class
project
extends
control
{
public function
delete
(
$projectID
)
{
$this
->
project
->delete(
TABLE_PROJECT
,
$projectID
);
$this
->
dao
->update(
TABLE_TASK
)->set(
'deleted'
)->eq(
1
)->where(
'project'
)->eq(
$projectID
)->e x e c();
if
(dao::
isError
())
$this
->send(
array
(
'result'
=>
'fail'
,
'message'
=> dao::
getError
()));
$this
->send(
array
(
'result'
=>
'success'
));
}
}
|
王春生
|
关联删除操作太危险,也不合理。
|
1/1
