mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-10 18:02:55 +00:00
fix: 文件搜索不到根目录的共享
This commit is contained in:
parent
3c400af559
commit
79898d87c0
@ -181,6 +181,7 @@ class File extends AbstractModel
|
||||
if ($this->share != $share) {
|
||||
AbstractModel::transaction(function () use ($share) {
|
||||
$this->share = $share;
|
||||
$this->pshare = $share ? $this->id : 0;
|
||||
$this->save();
|
||||
File::where("pids", "like", "%,{$this->id},%")->update(['pshare' => $share ? $this->id : 0]);
|
||||
if ($share === 0) {
|
||||
|
||||
26
database/migrations/2023_04_01_164418_update_file_pshare.php
Normal file
26
database/migrations/2023_04_01_164418_update_file_pshare.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateFilePshare extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
\App\Models\File::whereShare(1)->wherePshare(0)->update(['pshare' => DB::raw('id')]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user