Home > Back-end > Ask your bosses help small white busy, my head will blow up, don't know how to write, in this f
Ask your bosses help small white busy, my head will blow up, don't know how to write, in this f
Time:11-29
CodePudding user response:
Logic to rationalize, several main object:
Project, members, the file
A user can belong to multiple members of the project; Users can upload files under the project, the sharing of files can be private or project team; Users can view their projects under the private and Shared file;
The user (uid) Project (pid) Project_member (pid, uid) The file (id, pid, uid, see_type)//see_type visible type 1-2 - sharing private
For button permissions, you can on the page based on user roles, role can configure button permissions
CodePudding user response:
Use the SQL!
Select * from file table where A (a. project id (in the Among the select B.a udit_id from table B where user_id=? ) And A.s tatus=0 and A.u ser_id!=)? The or a. user_id==?
You don't and I said file table no project id, if not, then this table design is definitely has a problem, Your user corresponding to multiple projects, no project id file table, don't judge this file belongs to which project, If it is your own doing project, hurriedly with this field, if not their own, to get over the problem feedback to your group,
CodePudding user response:
The third paradigm, in fact, in order to comply with the database, you should separate out a table to record file attributes, should not let the documents show the level and project id, I found my dimmed eyesight, you file list is a project id
Select * from file table A where clause (a. d. raftAuditProjectId in ( Among the select B.a udit_id from table B where user_id=? ) And A.s tatus=0 and A.u ser_id!=)? The or a. user_id==?