wang jun 3 tahun lalu
induk
melakukan
5c213b31ff

+ 21 - 5
application/index/controller/Resume.php

@@ -96,7 +96,8 @@ class Resume extends Base
      *
      * @return void
      */
-    public function getsendedresumebywhere(){
+    public function getsendedresumebywhere()
+    {
         $param = request()->param();
         $l_r = new resumelogic();
         $result = $l_r->getsendedresumebywhere($param);
@@ -107,13 +108,28 @@ class Resume extends Base
         $list = $result['data'];
         $l_r = new resumelogic();
         foreach ($list as $key => $value) {
-            $where =['id'=>$value['resume_id']];
+            $where = ['id' => $value['resume_id']];
             $result = $l_r->getallinfobyid($where);
-            if(1==$result['status']){
+            if (1 == $result['status']) {
                 $rlist[] = $result['data'];
-                 
+
             }
-        } 
+        }
         return backjson(200, $rlist);
     }
+    /**
+     * 修改投递状态 根据投递的id
+     * 20220127
+     * wj
+     * */
+    public function updatesendstatusbyid()
+    {
+        $param = request()->param();
+        $l_r = new resumelogic();
+        $result = $l_r->updatesendstatusbyid($param);
+        if (1 != $result['status']) {
+            return backjson(0, $result['msg']);
+        }
+        return backjson(200, $result['data']);
+    }
 }

+ 26 - 0
application/index/logic/resumelogic.php

@@ -58,6 +58,10 @@ class resumelogic extends baselogic
             'getallinfobyid' => [
                 ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'numeric'],
             ],
+            'updatesendstatusbyid' => [
+                ['name' => 'sendid', 'title' => 'sendid', 'require' => true, 'type' => 'numeric'],
+                ['name' => 'status', 'title' => 'status', 'require' => true, 'type' => 'numeric', 'regex' => '/[0|1|2]{1}/'],
+            ],
         ];
         return $list;
     }
@@ -368,4 +372,26 @@ class resumelogic extends baselogic
         $list = $m_s->getList($where, '*', $page, $size);
         return backarr(1, "查询成功", $list);
     }
+    /**
+     * 修改投递状态 根据投递的id
+     * 20220127
+     * wj
+     * */
+    public function updatesendstatusbyid($arr)
+    {
+        $result = $this->checkparam(__FUNCTION__, $arr);
+        if (1 != $result['status']) {
+            return $result;
+        }
+        $sendid = $arr['sendid'];
+        $status = $arr['status'];
+        $m_s = new sendrecordmodel();
+        $info = $m_s->getinfobyid($sendid);
+        if (empty($info)) {
+            return backarr(0, "无数据");
+        }
+        $row = $m_s->updatestatusbyid($info['id'], $status);
+        return backarr(1, "修改成功", ['id' => $info['id']]);
+    }
+
 }

+ 23 - 0
application/index/model/sendrecordmodel.php

@@ -79,4 +79,27 @@ class sendrecordmodel extends Model
         }
         return $data;
     }
+    /**
+     * 根据id 获取数据
+     * 20220127
+     * wj
+     */
+    public function getinfobyid($id)
+    {
+        $where = ['id' => $id];
+        $info = $this->where($where)->find();
+        return empty($info) ? false : $info;
+    }
+    /**
+     * 根据id 修改status
+     * 20220127
+     * wj
+     */
+    public function updatestatusbyid($id, $status)
+    {
+        $where = ['id' => $id];
+        $updateData = ['status' => $status];
+        $row = $this->where($where)->update($updateData);
+        return empty($row) ? false : $row;
+    }
 }