|
@@ -158,6 +158,43 @@ class Resign extends BaseController
|
|
|
return $in ? app_show(0,"新建成功",['bk_code'=>$bk_code]):error_show(1005,"新建失败");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return \think\response\Json|void
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\DbException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ */
|
|
|
+ public function copy(){
|
|
|
+ $id = isset($this->post['id']) ? intval($this->post['id']) : "";
|
|
|
+ if($id==""){
|
|
|
+ return error_show(1001,'id不能为空');
|
|
|
+ }
|
|
|
+ $info = Db::name("purchease")->where(["id"=>$id,"is_del"=>0])->find();
|
|
|
+ if(empty($info)){
|
|
|
+ return error_show(1002,'未找到数据');
|
|
|
+ }
|
|
|
+ $data = GetUserInfo($this->post['token']);
|
|
|
+ if((!empty($data) && $data['code']!=0) ||empty($data) ){
|
|
|
+ return error_show($data['code'],$data['message']);
|
|
|
+ }
|
|
|
+ $userinfo = $data['data'];
|
|
|
+ $bk_code=makeNo("BK");
|
|
|
+ $info['bk_code']=$bk_code;
|
|
|
+ $info['status']=0;
|
|
|
+ $info['addtime']=date("Y-m-d H:i:s");
|
|
|
+ $info['updatetime']=date("Y-m-d H:i:s");
|
|
|
+ $info['apply_id']=$userinfo['id'];
|
|
|
+ $info['apply_name']=$userinfo['nickname'];
|
|
|
+ unset($info['id']);
|
|
|
+ $in = Db::name("purchease")->insert($info);
|
|
|
+ return $in ? app_show(0,"新建成功",['bk_code'=>$bk_code]):error_show(1005,"新建失败");
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @return \think\response\Json|void
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\DbException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ */
|
|
|
public function info(){
|
|
|
$id = isset($this->post['id']) ? intval($this->post['id']) : "";
|
|
|
if($id==""){
|