当前位置:网站首页>About I double-checked and reviewed the About staff page, returning an industry question
About I double-checked and reviewed the About staff page, returning an industry question
2022-08-05 00:20:00 【Jingxing three thousand】
About me double-checked and reviewed the About staff page, returning an industry question
Here's the thing, last night I received a - so-called small request - staff page, returning an industry question
So record it.
First of all, the database cd_workers table does not have an industry field, so it is impossible to return it through ordinary methods. There is indeed a personnel category id
However,
The original person category id is strange, it does not correspond to the database-person category table- at all, it is simply wrong.Regarding this point, you can go directly to the gldgwid field of the cd_workers table, and then go to the cd_personnel_categories table for comparison, but some of the data are correct, and the correct data is correct after I wrote the personnel category table, that is to say, I currently estimate80% of the data (the so-called original) are not controlled.That is, the data in the first 9 pages or so of the database are not compared.
Assuming that everything is correct, then go through -person category table- to get the industry you belong to. It's no problem to get it (that is, to get the industry you belong to by getting gldgwid to cd_personnel_categories), but it can't be returned, the reasonThe return value type in the pageworkelist method is cd_worker, why is it cd_worker, because this table must be checked, this page is a worker, so all fields are from cd_worker, which is why the code checks this table, each piece of data is cd_workerAll fields of cd_worker, so it can return the data of all fields under cd_worker, but no fields cannot be returned, because multiple returned fields will cause type mismatch, which is simply not possible (db.table("cd_workers").Find(&abc)), abc is a slice with one more field than cd_workers.
Sounds, then we just add an Industry field to the cd_workers table, right?
Wrong, not only, for the staff module, adding a new field is very expensive, and it is necessary to change multiple related methods, such as crud, pagelist, etc.And there is a serious difficulty.At first, this table did not belong to the industry, and now a new one is added. How can the previously registered account get the industry it belongs to?You will definitely say: go to the cd_personnel_categories table and get it, just get it, wrong, as mentioned earlier, 80% of the data are wrong, and regardless of whether this method can be implemented, what will happen if it is implemented?Yes, 80% of the staff data will get a fake industry. What does it mean? For example: classmate a was originally an underground worker, working for rice. This category of staff may get a pick because of the wrong gldgwid before.Dung - Person Category.Isn't this messed up?Originally, I wanted to obtain the industry to which I belonged, but now I have achieved it. The industry is not my own industry, and the category of personnel is wrong.
So is there really no way to improve it?
Of course not, there must be a solution to any problem, but there is a price to pay. We can force this function, and there will be a minimum cost, but even the minimum cost is very dangerous. Let's take a look at the solution
/p>
As 04 said, there will be no problem with the newly added staff in the future. If we don't tangle with the previous data, in fact, no one pays attention to the industry of the staff member, and everyone does not write it for registration.The personnel category and industry of this registration information, then change it. Now let’s talk about this technology. Under the pageworkerlist method, we can get the industry to which we belong, and when we return, we will not report an error that the type does not match.The task is completed, and the cost: adding a new field, crud method and pageworkerlist and other methods may need to be changed accordingly, and the inspection cost is very high.Other potential dangers have not been discovered for the time being.
边栏推荐
猜你喜欢

大师教你3D实时角色制作流程,游戏建模流程分享

10 种常见的BUG分类

How to burn the KT148A voice chip into the chip through the serial port and the tools on the computer

oracle创建用户

2 用D435i运行VINS-fusion

MongoDB permission verification is turned on and mongoose database configuration

资深游戏建模师告知新手,游戏场景建模师必备软件有哪些?

典型相关分析CCA计算过程

Essential knowledge for entry-level 3D game modelers

仿网易云音乐小程序-uniapp
随机推荐
【无标题】
Mathematical Principles of Matrix
Flask框架 根据源码分析可扩展点
oracle创建用户
倒计时1天!8月2日—4日与你聊聊开源与就业那些事!
Implementation principle of golang coroutine
阅读笔记:如何理解DevOps?
lua 如何 实现一个unity协程的工具
[LeetCode] Summary of Matrix Simulation Related Topics
Brainstorm: Complete Backpack
Senior game modelers tell newbies, what are the necessary software for game scene modelers?
jenkins发送邮件系统配置
The master teaches you the 3D real-time character production process, the game modeling process sharing
3. Actual combat---crawl the result page corresponding to Baidu's specified entry (a simple page collector)
typeScript - Partially apply a function
How to burn the KT148A voice chip into the chip through the serial port and the tools on the computer
Some thoughts on writing
英特尔WiFi 7产品将于2024年亮相 最高速度可达5.8Gbps
GO中sync包自由控制并发的方法
Getting started with 3D modeling for games, what modeling software can I choose?