1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- /*
- * @Author: wang jun
- * @Date: 2021-09-27 09:02:06
- * @Last Modified by: wang jun
- * @Last Modified time: 2021-10-22 15:46:16
- */
- namespace app\index\logic;
- use app\index\model\userinfomodel;
- use app\index\model\workerskillmodel;
- class workerskilllogic
- {
- public function getinfobyid($id)
- {
- $m_wt = new workerskillmodel();
- $where = ['id' => $id];
- $info = $m_wt->getInfo($where);
- return $info;
- }
- public function insertinfo($info)
- {
- $m_wt = new workerskillmodel();
- $m_u = new userinfomodel();
- if (!isset($info['uid']) || empty($info['uid'])) {
- return backarr(0, "请求错误");
- }
- $uid = $info['uid'];
- $userinfo = $m_u->getInfo(['id' => $uid]);
- if (empty($userinfo)) {
- return backarr(0, "无用户数据");
- }
- $id = $m_wt->insertData($info);
- return backarr(1, "新增成功", ['id' => $id]);
- }
- public function updateinfobyid($id, $updateData)
- {
- $m_wt = new workerskillmodel();
- $where = ['id' => $id];
- $result = $m_wt->updateinfo($where, $updateData);
- return $result;
- }
- public function getlistonepage($arr)
- {
- $where = [];
- $m_wt = new workerskillmodel();
- $count = $m_wt->getList($where, 'count');
- if ($count <= 0) {
- return backarr(0, "无数据");
- }
- $list = $m_wt->getList($where, '*', 1, 0, "id desc");
- return backarr(1, "查询成功", $list);
- }
- /*
- * 20211022
- * 获取指定用户的工作技能
- * steelxu5
- */
- public function getlistbyuid($arr){
- $uid=$arr['uid'];
- $where = ['uid' => $uid];
- $m_wt = new workerskillmodel();
- $count = $m_wt->getList($where, 'count');
- if ($count <= 0) {
- return backarr(0, "无数据");
- }
- $list = $m_wt->getList($where, '*', 1, 0, "id desc");
- return backarr(1, "查询成功", $list);
- }
- }
|