master
cody 6 months ago
parent 2b738b7ba7
commit 6d3b6ffba2

@ -86,6 +86,9 @@ class SupplyDemandController extends CommonController
$detail = SupplyDemand::with(['user' => function ($query) {
$query->select('id', 'nickname', 'name', 'headimgurl');
}])->find($all['id']);
// 增加view_count
$detail->increment('view_count');
$detail->save();
return $this->success($detail);
}
@ -103,6 +106,7 @@ class SupplyDemandController extends CommonController
* @OA\Parameter(name="wechat", in="query", @OA\Schema(type="string"), required=false, description="微信号"),
* @OA\Parameter(name="mobile", in="query", @OA\Schema(type="string"), required=false, description="电话"),
* @OA\Parameter(name="email", in="query", @OA\Schema(type="string"), required=false, description="邮箱"),
* @OA\Parameter(name="expire_time", in="query", @OA\Schema(type="string"), required=false, description="过期时间"),
* @OA\Parameter(name="status", in="query", @OA\Schema(type="integer"), required=false, description="审核状态0待审核1通过2拒绝"),
* @OA\Response(
* response="200",
@ -231,6 +235,9 @@ class SupplyDemandController extends CommonController
'content' => $all['content'],
'is_read' => 0
]);
// 增加view_count
$model->increment('contact_count');
$model->save();
return $this->success('删除成功');
}

@ -32,6 +32,12 @@ return new class extends Migration {
$table->string('email')->nullable()->comment('邮箱');
// 审核状态
$table->tinyInteger('status')->default(0)->comment('状态0待审核1通过2拒绝');
// 浏览次数
$table->integer('view_count')->default(0)->comment('浏览次数');
// 联系次数
$table->integer('contact_count')->default(0)->comment('联系次数');
// 有效期
$table->string('expire_time')->nullable()->comment('有效期');
$table->timestamps();
$table->softDeletes();
});

Loading…
Cancel
Save