فهرست منبع

连接口 需求专家项目公司成果

zs 10 ماه پیش
والد
کامیت
a7a94a6c72

+ 0 - 1
src/entity/platform/demand.entity.ts

@@ -48,5 +48,4 @@ export class Demand extends BaseModel {
   tec_name: string;
   @Column({ type: 'character varying', nullable: true, comment: '待解决问题' })
   question: string;
-  
 }

+ 2 - 2
src/service/platform/achievement.service.ts

@@ -16,9 +16,9 @@ export class AchievementService extends BaseService<Achievement> {
   uModel: Repository<User>;
   // 成果列表
   async list(query) {
-    const { skip = 0, limit = 0, is_use, status, ...condition } = pick(query, ['skip', 'limit', 'is_use', 'status']);
+    const { skip = 0, limit = 0, is_use, status, field, ...condition } = pick(query, ['skip', 'limit', 'is_use', 'field', 'status']);
     const { one, two, thr, four, five, six } = pick(query, ['one', 'two', 'thr', 'four', 'five', 'six']);
-    const whereObject: any = {};
+    const whereObject: any = { field };
     // if (is_use) whereObject.is_use = Equal(is_use);
     // if (status) whereObject.status = Equal(status);
     if (one) whereObject.technology = In(one);

+ 2 - 1
src/service/platform/demand.service.ts

@@ -27,8 +27,9 @@ export class DemandService extends BaseService<Demand> {
     const two = get(query, 'two');
     const thr = get(query, 'thr');
     const four = get(query, 'four');
+    const field = get(query, 'field');
 
-    const whereObject: any = {};
+    const whereObject: any = { field };
     // if (is_use) whereObject.is_use = Equal(is_use);
     // if (status) whereObject.status = Equal(status);
     if (one) whereObject.field = In(one);

+ 12 - 5
src/service/platform/supply.service.ts

@@ -16,12 +16,20 @@ export class SupplyService extends BaseService<Supply> {
   uModel: Repository<User>;
   // 需求列表
   async list(query) {
-    const { skip = 0, limit = 0, is_use, status, ...condition } = pick(query, ['skip', 'limit', 'is_use', 'status']);
-    const { one, two, thr, four } = pick(query, ['one', 'two', 'thr', 'four']);
+    // const { skip = 0, limit = 0, is_use, status, ...condition } = query;
+    const skip = get(query, 'skip', 0);
+    const limit = get(query, 'limit', 0);
+    const is_use = get(query, 'is_use');
+    const status = get(query, 'status');
+    // const { one, two, thr, four } = condition;
+    const one = get(query, 'one');
+    const two = get(query, 'two');
+    const thr = get(query, 'thr');
+    const four = get(query, 'four');
 
     const whereObject: any = {};
-    if (is_use) whereObject.is_show = Equal(is_use);
-    if (status) whereObject.status = Equal(status);
+    // if (is_use) whereObject.is_use = Equal(is_use);
+    // if (status) whereObject.status = Equal(status);
     if (one) whereObject.field = In(one);
     if (two) whereObject.method = In(two);
     if (thr) whereObject.area = In(thr);
@@ -29,7 +37,6 @@ export class SupplyService extends BaseService<Supply> {
     const builder = this.model.createQueryBuilder().setFindOptions({ where: whereObject, skip, take: limit });
     const data = await builder.getMany();
     const total = await builder.getCount();
-
     // const info: any = { is_use, status };
     // if (one) info.field = { $in: one };
     // if (two) info.method = { $in: two };