|
@@ -48,7 +48,7 @@ func (this *EntExportAuth) Set() {
|
|
if Mysql.ExecTx("设置数据导出权限", func(tx *sql.Tx) bool {
|
|
if Mysql.ExecTx("设置数据导出权限", func(tx *sql.Tx) bool {
|
|
ok_1 := Mysql.UpdateOrDeleteBySqlByTx(tx, "update entniche_user set export_power=0 where ent_id=? and export_power=1", entId)
|
|
ok_1 := Mysql.UpdateOrDeleteBySqlByTx(tx, "update entniche_user set export_power=0 where ent_id=? and export_power=1", entId)
|
|
ok_2 := Mysql.UpdateOrDeleteBySqlByTx(tx, "update entniche_user set export_power=1 where id in ("+ws+") and ent_id=?", args...)
|
|
ok_2 := Mysql.UpdateOrDeleteBySqlByTx(tx, "update entniche_user set export_power=1 where id in ("+ws+") and ent_id=?", args...)
|
|
- ok_3 := Mysql.UpdateOrDeleteBySqlByTx(tx, `INSERT INTO entniche_export_limit (ent_id,user_id) SELECT ent_id,id AS user_id FROM entniche_user a WHERE id IN (`+ws+`) AND ent_id=? AND NOT EXISTS (SELECT 1 FROM entniche_export_limit b WHERE a.id=b.user_id`, args...)
|
|
|
|
|
|
+ ok_3 := Mysql.UpdateOrDeleteBySqlByTx(tx, `INSERT INTO entniche_export_limit (ent_id,user_id) SELECT ent_id,id AS user_id FROM entniche_user a WHERE id IN (`+ws+`) AND ent_id=? AND NOT EXISTS (SELECT 1 FROM entniche_export_limit b WHERE a.id=b.user_id)`, args...)
|
|
ok_4 := Mysql.UpdateOrDeleteBySqlByTx(tx, `INSERT INTO entniche_export_limit_log (user_id,data_limit,max_nums,TYPE) SELECT user_id,data_limit,max_nums,0 FROM entniche_export_limit WHERE user_id IN (`+ws+`) AND ent_id=?`, args...)
|
|
ok_4 := Mysql.UpdateOrDeleteBySqlByTx(tx, `INSERT INTO entniche_export_limit_log (user_id,data_limit,max_nums,TYPE) SELECT user_id,data_limit,max_nums,0 FROM entniche_export_limit WHERE user_id IN (`+ws+`) AND ent_id=?`, args...)
|
|
return ok_1 > -1 && ok_2 > 0 && ok_3 > -1 && ok_4 > 0
|
|
return ok_1 > -1 && ok_2 > 0 && ok_3 > -1 && ok_4 > 0
|
|
}) {
|
|
}) {
|