Code Monkey home page Code Monkey logo

laravel-shop's Issues

这个表丢失?

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) (SQL: select count(*) as aggregate from products where on_sale = 1)

php.exe artisan admin:install安装导致表编码和排序都是utf8mb4,不知是本地原因还是框架本身原因

我直接在GitHub上down下来的,分支(L05_5.7)
php.exe artisan admin:install安装导致表编码和排序都是utf8mb4,
错误:
Migrating: 2014_10_12_000000_create_users_table

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))

不知是本地原因还是框架本身原因
框架Laravel Framework 5.7.17
PHP 7.2.22 (cli) (built: Aug 28 2019 09:29:01) ( ZTS MSVC15 (Visual C++ 2017) x64 )
windows10
10.1.24-MariaDB, for Win32 (AMD64)

我创建的数据库是utf8 -- UTF-8 Unicode的编码以及utf8_general_ci排序

但是一执行artisan admin:install 就报错,把user表设置为了CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;,然后给email字段设置unique索引的时候就会报超出767个字节错误,我不能挨个改字段长度,我也不能挨个加编码,我只能手动改框架本身的设置,统一默认设置为utf8以及utf8_unicode_ci排序,
请问一下这是我操作的问题还是项目本身的问题?

我需要重新建表吗

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.products' doesn't exist (SQL: select count(*) as aggregate from products where on_sale = 1)

self static 不同

在model,order中

 public static function findAvailableNo()
    {
        // 订单流水号前缀
        $prefix = date('YmdHis');
        for ($i = 0; $i < 10; $i++) {
            // 随机生成 6 位的数字
            $no = $prefix.str_pad(random_int(0, 999999), 6, '0', STR_PAD_LEFT);
            // 判断是否已经存在
            if (!static::query()->where('no', $no)->exists()) {
                return $no;
            }
            usleep(100);
        }
        \Log::warning(sprintf('find order no failed'));
        return false;
    }
    public static function getAvailableRefundNo()
    {
        do {
            // Uuid类可以用来生成大概率不重复的字符串
            $no = Uuid::uuid4()->getHex();
            // 为了避免重复我们在生成之后在数据库中查询看看是否已经存在相同的退款订单号
        } while (self::query()->where('refund_no', $no)->exists());
        return $no;
    }

看到一个使用self::query 一个 使用 static::query 这两处为什么不保持统一,是说注意到了self和static的区别,还是忽略

',' expected.javascript

// Laravel-Admin 没有 axios,使用 jQuery 的 ajax 方法来请求
return $.ajax({
url: '{{ route('admin.orders.handle_refund', [$order->id]) }}',
type: 'POST',

安装完成后,报404

nginx日志如下;

➜ logs cat nginx_common_error.log
2019/02/01 15:22:54 [error] 71536#0: *41 open() "/Applications/MxSrvs/www/shop/public/products" failed (2: No such file or directory), client: 127.0.0.1, server: dev.shop.com, request: "GET /products HTTP/1.1", host: "dev.shop.com"

看了一下路由文件,好像没有什么问题;
翻了一下以前的issues,也没有类似的问题;

求助;

advanced分支获取不到es索引

配置好后打开首页报错
{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [products]","resource.type":"index_or_alias","resource.id":"products","index_uuid":"na","index":"products"}],"type":"index_not_found_exception","reason":"no such index [products]","resource.type":"index_or_alias","resource.id":"products","index_uuid":"na","index":"products"},"status":404}
应该怎么创建索引来着?

install Laravel Horizon error (安装laravel-horizon报错)

  • Conclusion: remove laravel/framework v5.7.17
    • Conclusion: don't install laravel/framework v5.7.17
    • laravel/horizon 4.x-dev requires illuminate/queue ^7.0 -> satisfiable by illuminate/queue[7.x-dev, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.2.0, v7.2.1, v7.2.2, v7.3.0, v7.4.0, v7.5.0, v7.5.1, v7.5.2].
    • laravel/horizon v4.2.0 requires illuminate/queue ^7.0 -> satisfiable by illuminate/queue[7.x-dev, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.2.0, v7.2.1, v7.2.2, v7.3.0, v7.4.0, v7.5.0, v7.5.1, v7.5.2].
    • laravel/horizon v4.2.1 requires illuminate/queue ^7.0 -> satisfiable by illuminate/queue[7.x-dev, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.2.0, v7.2.1, v7.2.2, v7.3.0, v7.4.0, v7.5.0, v7.5.1, v7.5.2].
    • don't install illuminate/queue 7.x-dev|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.0.0|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.0.1|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.0.2|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.0.3|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.0.4|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.0.5|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.0.6|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.0.7|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.0.8|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.1.0|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.1.1|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.1.2|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.1.3|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.2.0|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.2.1|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.2.2|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.3.0|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.4.0|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.5.0|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.5.1|don't install laravel/framework v5.7.17
    • don't install illuminate/queue v7.5.2|don't install laravel/framework v5.7.17
    • Installation request for laravel/framework (locked at v5.7.17, required as 5.7.*) -> satisfiable by laravel/framework[v5.7.17].
    • Installation request for laravel/horizon ^4.2 -> satisfiable by laravel/horizon[4.x-dev, v4.2.0, v4.2.1].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.