Browse Source

修改b端添加及修改企业0的接口(添加字段推荐等级)

15313670163 5 days ago
parent
commit
96a2298d8b

+ 6 - 8
app/JsonRpc/NewsService.php

@@ -5910,8 +5910,6 @@ class NewsService implements NewsServiceInterface
      */
     public function upCompany(array $data): array
     {
-      
-        
         if(isset($data['cat_arr_id']) &&!empty($data['cat_arr_id']) && is_array($data['cat_arr_id'])){
             $car_arr_id = array_values(array_unique(array_map('intval', $data['cat_arr_id'])));
             $data['cat_arr_id'] = json_encode($car_arr_id);
@@ -5919,14 +5917,12 @@ class NewsService implements NewsServiceInterface
         }else{
             $data['cat_arr_id'] = '';
         }
-        
-        // $data['cat_arr_id'] = isset($data['cat_arr_id']) ? json_encode($data['cat_arr_id']) : '';
         if ($data['imgurl'] == '') {
             //content中提取图片第一个图,正则提取
             $reg = '/<img.*?src=[\"|\']?(.*?)[\"|\']?\s.*?>/i';
             preg_match_all($reg, $data['content'], $matches);
             if (isset($matches[1][0])) {
-                //截取varchar240
+                //截取varchar
                 $data['imgurl'] = substr($matches[1][0], 0, 240);
             } 
         }
@@ -5944,10 +5940,12 @@ class NewsService implements NewsServiceInterface
           //提取内容中的描述
           // var_dump(11111);
           $data['introduce'] = mb_substr(str_replace(' ', '', strip_tags($data['content'])), 0, 100);
-          // var_dump($data['introduce']);
         }
-        // return Result::success($data);
-
+        if(isset($data['level']) && $data['level'] != null){
+            $data['level'] = intval($data['level']);
+        }else{
+            $data['level'] = null;
+        }
         $user = User::where('id', $data['user_id'])->first();
         if(empty($user)){
             return Result::error('用户不存在!');

+ 1 - 1
runtime/hyperf.pid

@@ -1 +1 @@
-58471
+9286

+ 1 - 0
vendor/composer/autoload_classmap.php

@@ -25,6 +25,7 @@ return array(
     'App\\Model\\ChatGroupsMember' => $baseDir . '/app/Model/ChatGroupsMember.php',
     'App\\Model\\ChatRecords' => $baseDir . '/app/Model/ChatRecords.php',
     'App\\Model\\Company' => $baseDir . '/app/Model/Company.php',
+    'App\\Model\\Complaint' => $baseDir . '/app/Model/Complaint.php',
     'App\\Model\\Couplet' => $baseDir . '/app/Model/Couplet.php',
     'App\\Model\\District' => $baseDir . '/app/Model/District.php',
     'App\\Model\\Festival' => $baseDir . '/app/Model/Festival.php',

+ 1 - 0
vendor/composer/autoload_static.php

@@ -776,6 +776,7 @@ class ComposerStaticInit93d050353fc587b1b1fb188f0a8c068c
         'App\\Model\\ChatGroupsMember' => __DIR__ . '/../..' . '/app/Model/ChatGroupsMember.php',
         'App\\Model\\ChatRecords' => __DIR__ . '/../..' . '/app/Model/ChatRecords.php',
         'App\\Model\\Company' => __DIR__ . '/../..' . '/app/Model/Company.php',
+        'App\\Model\\Complaint' => __DIR__ . '/../..' . '/app/Model/Complaint.php',
         'App\\Model\\Couplet' => __DIR__ . '/../..' . '/app/Model/Couplet.php',
         'App\\Model\\District' => __DIR__ . '/../..' . '/app/Model/District.php',
         'App\\Model\\Festival' => __DIR__ . '/../..' . '/app/Model/Festival.php',

+ 2 - 2
vendor/composer/installed.php

@@ -3,7 +3,7 @@
         'name' => 'hyperf/hyperf-skeleton',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => 'aeff99533d628447c4fbb8f7f02c347c3375ace7',
+        'reference' => '9d12071cf0586267e5cb1c8008d745bd7632820e',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
@@ -457,7 +457,7 @@
         'hyperf/hyperf-skeleton' => array(
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => 'aeff99533d628447c4fbb8f7f02c347c3375ace7',
+            'reference' => '9d12071cf0586267e5cb1c8008d745bd7632820e',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),

+ 3 - 1
vendor/hyperf/cache/src/Annotation/CacheAhead.php

@@ -24,6 +24,7 @@ class CacheAhead extends AbstractAnnotation
 {
     /**
      * @param null|int $ttl the max offset for ttl
+     * @param bool $runAsync when this method is executed for the first time, the original method is executed asynchronously and cached, so the return value is null
      */
     public function __construct(
         public ?string $prefix = null,
@@ -34,7 +35,8 @@ class CacheAhead extends AbstractAnnotation
         public int $offset = 0,
         public string $group = 'default',
         public bool $collect = false,
-        public ?array $skipCacheResults = null
+        public ?array $skipCacheResults = null,
+        public bool $runAsync = false,
     ) {
     }
 

+ 8 - 0
vendor/hyperf/cache/src/Aspect/CacheAheadAspect.php

@@ -39,6 +39,9 @@ class CacheAheadAspect extends AbstractAspect
         $arguments = $proceedingJoinPoint->arguments['keys'];
         $now = time();
 
+        /**
+         * @var CacheAhead $annotation
+         */
         [$key, $ttl, $group, $annotation] = $this->annotationManager->getCacheAheadValue($className, $method, $arguments);
         $driver = $this->manager->getDriver($group);
 
@@ -78,6 +81,11 @@ class CacheAheadAspect extends AbstractAspect
         }
 
         // If the cache does not exist, execute the callback and cache the result.
+        if ($annotation->runAsync) {
+            Coroutine::create($callback);
+            return null;
+        }
+
         return $callback();
     }
 }

+ 1 - 1
vendor/hyperf/cache/src/Driver/CoroutineMemoryDriver.php

@@ -53,7 +53,7 @@ class CoroutineMemoryDriver extends Driver implements KeyCollectorInterface
     public function setMultiple($values, $ttl = null): bool
     {
         foreach ($values as $key => $value) {
-            $this->set($key, $values, $ttl);
+            $this->set($key, $value, $ttl);
         }
 
         return true;

+ 2 - 0
vendor/hyperf/command/src/AsCommand.php

@@ -29,9 +29,11 @@ final class AsCommand extends Command
         string $signature,
         private string $class,
         private string $method,
+        bool $coroutine = true,
     ) {
         $this->signature = $signature;
         $this->parameterParser = $container->get(ParameterParser::class);
+        $this->coroutine = $coroutine;
 
         parent::__construct();
 

+ 7 - 0
vendor/hyperf/command/src/ClosureCommand.php

@@ -75,6 +75,13 @@ final class ClosureCommand extends Command
         return $this;
     }
 
+    public function coroutine(bool $coroutine): self
+    {
+        $this->coroutine = $coroutine;
+
+        return $this;
+    }
+
     /**
      * @param null|callable(Crontab $crontab):Crontab $callback
      */

+ 1 - 1
vendor/hyperf/coroutine/composer.json

@@ -19,7 +19,7 @@
         "php": ">=8.1",
         "hyperf/context": "~3.1.0",
         "hyperf/contract": "~3.1.0",
-        "hyperf/engine": "^2.13.0"
+        "hyperf/engine": "^2.14.0"
     },
     "autoload": {
         "psr-4": {

+ 7 - 2
vendor/hyperf/database/src/Commands/ModelCommand.php

@@ -158,10 +158,15 @@ class ModelCommand extends Command
         $table = Str::replaceFirst($option->getPrefix(), '', $table);
         $pureTable = Str::after($table, '.');
         $databaseName = Str::contains($table, '.') ? Str::before($table, '.') : null;
-        $columns = $this->formatColumns($builder->getColumnTypeListing($pureTable, $databaseName));
+        $driver = $this->resolver->connection($option->getPool())->getConfig('driver');
+        $columns = match ($driver) {
+            'pgsql' => $this->formatColumns($builder->getColumnTypeListing($table, $databaseName)),
+            default => $this->formatColumns($builder->getColumnTypeListing($pureTable, $databaseName)),
+        };
+
         if (empty($columns)) {
             $this->output?->error(
-                sprintf('Query columns empty, maybe is table `%s` does not exist.You can check it in database.', $table)
+                sprintf('Query columns are empty, maybe the table `%s` does not exist. You can check it in the database.', $table)
             );
         }
 

+ 9 - 0
vendor/hyperf/database/src/Schema/Blueprint.php

@@ -153,6 +153,10 @@ class Blueprint
         $this->ensureCommandsAreValid($connection);
 
         foreach ($this->commands as $command) {
+            if ($command->shouldBeSkipped) {
+                continue;
+            }
+
             $method = 'compile' . ucfirst($command->name);
 
             if (method_exists($grammar, $method)) {
@@ -1488,6 +1492,11 @@ class Blueprint
         $this->addFluentIndexes();
 
         $this->addFluentCommands($grammar);
+
+        // Add table comment command for PostgreSQL if table has comment and is being created
+        if ($this->creating() && ! empty($this->comment) && in_array('TableComment', $grammar->getFluentCommands())) {
+            $this->addCommand('tableComment', ['value' => $this->comment]);
+        }
     }
 
     /**

+ 13 - 1
vendor/hyperf/database/src/Schema/Grammars/MySqlGrammar.php

@@ -529,11 +529,23 @@ class MySqlGrammar extends Grammar
      */
     protected function compileCreateTable($blueprint, $command, $connection)
     {
+        $tableStructure = $this->getColumns($blueprint);
+
+        if ($primaryKey = $this->getCommandByName($blueprint, 'primary')) {
+            $tableStructure[] = sprintf(
+                'primary key %s(%s)',
+                $primaryKey->algorithm ? 'using ' . $primaryKey->algorithm : '',
+                $this->columnize($primaryKey->columns)
+            );
+
+            $primaryKey->shouldBeSkipped = true;
+        }
+
         return sprintf(
             '%s table %s (%s)',
             $blueprint->temporary ? 'create temporary' : 'create',
             $this->wrapTable($blueprint),
-            implode(', ', $this->getColumns($blueprint))
+            implode(', ', $tableStructure)
         );
     }
 

+ 1 - 1
vendor/hyperf/watcher/src/Watcher.php

@@ -77,7 +77,7 @@ class Watcher
                 }
             } else {
                 $ret = exec(sprintf('%s %s/vendor/hyperf/watcher/collector-reload.php %s', $this->option->getBin(), BASE_PATH, $file));
-                if ($ret['code'] === 0) {
+                if (isset($ret['code']) && $ret['code'] === 0) {
                     $this->output->writeln('Class reload success.');
                 } else {
                     $this->output->writeln('Class reload failed.');