|
@@ -184,6 +184,7 @@ class TalentAllowance extends EnterpriseController {
|
|
$where = [];
|
|
$where = [];
|
|
$where[] = ["year", "=", $param["year"]];
|
|
$where[] = ["year", "=", $param["year"]];
|
|
$where[] = ["idCard", "=", $param["idCard"]];
|
|
$where[] = ["idCard", "=", $param["idCard"]];
|
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
$where[] = ["checkState", "not in", [MainState::NOTPASS, MainState::PASS]];
|
|
$where[] = ["checkState", "not in", [MainState::NOTPASS, MainState::PASS]];
|
|
$exists = TaModel::where($where)->find();
|
|
$exists = TaModel::where($where)->find();
|
|
if ($exists) {
|
|
if ($exists) {
|
|
@@ -307,35 +308,37 @@ class TalentAllowance extends EnterpriseController {
|
|
*/
|
|
*/
|
|
public function delete() {
|
|
public function delete() {
|
|
$id = $this->request["id"];
|
|
$id = $this->request["id"];
|
|
- $response = new \stdClass();
|
|
|
|
- $response->code = 500;
|
|
|
|
$info = TalentAllowanceApi::getInfoById($id);
|
|
$info = TalentAllowanceApi::getInfoById($id);
|
|
if ($info["checkState"] != 1) {
|
|
if ($info["checkState"] != 1) {
|
|
- $response->msg = "删除失败!此数据已提交审核,无法删除!";
|
|
|
|
- return $response;
|
|
|
|
|
|
+ return new Response(Response::ERROR, "删除失败!此数据已提交审核,无法删除!");
|
|
}
|
|
}
|
|
Db::startTrans();
|
|
Db::startTrans();
|
|
try {
|
|
try {
|
|
- //删除核查项目表
|
|
|
|
- Db::table("un_talent_allowance_project")->where("mainId", $id)->delete();
|
|
|
|
- //删除合同情况表
|
|
|
|
- Db::table("un_talent_allowancecontract_detail")->where("mainId", $id)->delete();
|
|
|
|
- //删除人才层次变更表
|
|
|
|
- Db::table("un_talent_allowance_arrange")->where("mainId", $id)->delete();
|
|
|
|
- //删除日志
|
|
|
|
- $where[] = ["mainId", "=", $id];
|
|
|
|
- $where[] = ["type", "=", ProjectState::JBT];
|
|
|
|
- Db::table("new_talent_checklog")->where($where)->delete();
|
|
|
|
- //删除主表
|
|
|
|
- Db::table("un_talent_allowance_info")->delete($id);
|
|
|
|
|
|
+ /* 硬删
|
|
|
|
+ //删除核查项目表
|
|
|
|
+ Db::table("un_talent_allowance_project")->where("mainId", $id)->delete();
|
|
|
|
+ //删除合同情况表
|
|
|
|
+ Db::table("un_talent_allowancecontract_detail")->where("mainId", $id)->delete();
|
|
|
|
+ //删除人才层次变更表
|
|
|
|
+ Db::table("un_talent_allowance_arrange")->where("mainId", $id)->delete();
|
|
|
|
+ //删除日志
|
|
|
|
+ $where[] = ["mainId", "=", $id];
|
|
|
|
+ $where[] = ["type", "=", ProjectState::JBT];
|
|
|
|
+ Db::table("new_talent_checklog")->where($where)->delete();
|
|
|
|
+ //删除主表
|
|
|
|
+ Db::table("un_talent_allowance_info")->delete($id);
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+ $data["id"] = $id;
|
|
|
|
+ $data["delete"] = 1;
|
|
|
|
+ $data["deleteUser"] = $this->user["uid"];
|
|
|
|
+ $data["deleteTime"] = date("Y-m-d H:i:s");
|
|
|
|
+ Db::table("un_talent_allowance_info")->update($data);
|
|
Db::commit();
|
|
Db::commit();
|
|
- $response->code = 200;
|
|
|
|
- $response->msg = "删除成功";
|
|
|
|
- return $response;
|
|
|
|
|
|
+ return new Response(Response::SUCCESS, "删除成功");
|
|
} catch (think\db\exception\DbException $e) {
|
|
} catch (think\db\exception\DbException $e) {
|
|
Db::rollback();
|
|
Db::rollback();
|
|
- $response->msg = $e->getMessage();
|
|
|
|
- return $response;
|
|
|
|
|
|
+ return new Response(Response::ERROR, $e->getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -956,6 +959,7 @@ class TalentAllowance extends EnterpriseController {
|
|
$obj["address"] = \StrUtil::getRequestDecodeParam($this->request, "address");
|
|
$obj["address"] = \StrUtil::getRequestDecodeParam($this->request, "address");
|
|
$obj["identifyCondition"] = \StrUtil::getRequestDecodeParam($this->request, "identifyCondition");
|
|
$obj["identifyCondition"] = \StrUtil::getRequestDecodeParam($this->request, "identifyCondition");
|
|
$where = [];
|
|
$where = [];
|
|
|
|
+ $where[] = ["ta.delete", "=", 0];
|
|
$where[] = ["ta.enterpriseId", "=", $this->user["uid"]];
|
|
$where[] = ["ta.enterpriseId", "=", $this->user["uid"]];
|
|
if (\StrUtil::isNotEmpAndNull($obj["year"])) {
|
|
if (\StrUtil::isNotEmpAndNull($obj["year"])) {
|
|
$where[] = ["ta.year", "like", "%" . $obj["year"] . "%"];
|
|
$where[] = ["ta.year", "like", "%" . $obj["year"] . "%"];
|