|
...
|
...
|
@@ -321,12 +321,11 @@ class SyncProject extends Command |
|
|
|
* @time :2023/8/9 14:47
|
|
|
|
*/
|
|
|
|
public function setPostId($plan,$id){
|
|
|
|
$length = strlen((string)$id); // 获取变量的位数
|
|
|
|
$paddingLength = Project::TYPE_FIVE - $length; // 计算填充前面的 0 的位数
|
|
|
|
$zeros = str_repeat("0", $paddingLength);
|
|
|
|
$number = Project::TYPE_SIX.$plan.$zeros.$id;
|
|
|
|
$letters = range('A', 'X'); // 只取前 24 个字母(A ~ X)
|
|
|
|
$randomLetter = $letters[array_rand($letters)];
|
|
|
|
$post_id = $randomLetter.mt_rand(100000, 999999).$id;
|
|
|
|
$projectModel = new Project();
|
|
|
|
$projectModel->edit(['post_id'=>$number],['id'=>$id]);
|
|
|
|
$projectModel->edit(['post_id'=>$post_id],['id'=>$id]);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|