diff --git a/app/Http/Controllers/Mobile/SupplyDemandController.php b/app/Http/Controllers/Mobile/SupplyDemandController.php index 6d15121..b80a0f5 100755 --- a/app/Http/Controllers/Mobile/SupplyDemandController.php +++ b/app/Http/Controllers/Mobile/SupplyDemandController.php @@ -236,10 +236,6 @@ class SupplyDemandController extends CommonController if ($validator->fails()) { return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]); } - if (isset($all['supply_demand_id']) && !empty($all['supply_demand_id'])) { - // 增加view_count - SupplyDemand::where('id', $all['supply_demand_id'])->increment('view_count'); - } // 判断是否有会话,没有则创建 $dialogue = Dialogue::where(function ($query) use ($all) { $query->where('user_id', $this->getUserId())->where('to_user_id', $all['to_user_id']); @@ -253,6 +249,8 @@ class SupplyDemandController extends CommonController 'to_user_id' => $all['to_user_id'], 'supply_demand_id' => $all['supply_demand_id'] ?? 0 ]); + // 增加联系次数 + SupplyDemand::where('id', $all['supply_demand_id'])->increment('contact_count'); } // 每天限制私信次数限制 $message_limit = Config::getValueByKey('message_limit'); diff --git a/database/migrations/2025_06_23_170000_create_books_table.php b/database/migrations/2025_06_23_170000_create_books_table.php index 41d2cab..175529b 100644 --- a/database/migrations/2025_06_23_170000_create_books_table.php +++ b/database/migrations/2025_06_23_170000_create_books_table.php @@ -16,6 +16,7 @@ return new class extends Migration { $table->comment('图书表'); $table->increments('id'); $table->string('title')->comment('书名'); + $table->string('code')->comment('编码'); $table->string('author')->nullable()->comment('作者'); $table->string('isbn')->nullable()->comment('ISBN'); $table->string('publisher')->nullable()->comment('出版社');