diff --git a/database/migrations/20009999999965_install_wechat_table.php b/database/migrations/20009999999965_install_wechat_table.php deleted file mode 100644 index de92d10ec..000000000 --- a/database/migrations/20009999999965_install_wechat_table.php +++ /dev/null @@ -1,441 +0,0 @@ -_create_wechat_auth(); - $this->_create_wechat_auto(); - $this->_create_wechat_fans(); - $this->_create_wechat_fans_tags(); - $this->_create_wechat_keys(); - $this->_create_wechat_media(); - $this->_create_wechat_news(); - $this->_create_wechat_news_article(); - $this->_create_wechat_payment_record(); - $this->_create_wechat_payment_refund(); - - } - - /** - * 创建数据对象 - * @class WechatAuth - * @table wechat_auth - * @return void - */ - private function _create_wechat_auth() { - - // 当前数据表 - $table = 'wechat_auth'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-授权', - ]) - ->addColumn('authorizer_appid','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '微信APPID']) - ->addColumn('authorizer_access_token','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '授权Token']) - ->addColumn('authorizer_refresh_token','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '刷新Token']) - ->addColumn('expires_in','integer',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => 'Token时限']) - ->addColumn('user_alias','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号别名']) - ->addColumn('user_name','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '众众号原账号']) - ->addColumn('user_nickname','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号昵称']) - ->addColumn('user_headimg','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '公众号头像']) - ->addColumn('user_signature','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '公众号描述']) - ->addColumn('user_company','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '公众号公司']) - ->addColumn('func_info','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号集权']) - ->addColumn('service_type','string',['limit' => 10, 'default' => '', 'null' => true, 'comment' => '公众号类型']) - ->addColumn('service_verify','string',['limit' => 10, 'default' => '', 'null' => true, 'comment' => '公众号认证']) - ->addColumn('qrcode_url','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '公众号二维码']) - ->addColumn('businessinfo','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '业务序列内容']) - ->addColumn('miniprograminfo','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '小程序序列内容']) - ->addColumn('total','integer',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '统计调用次数']) - ->addColumn('appkey','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '应用接口KEY']) - ->addColumn('appuri','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '应用接口URI']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '授权状态(0已取消,1已授权)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('auth_time','integer',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '授权时间']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->addIndex('status', ['name' => 'ia87695d1d_status']) - ->addIndex('deleted', ['name' => 'ia87695d1d_deleted']) - ->addIndex('authorizer_appid', ['name' => 'ia87695d1d_authorizer_appid']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class WechatAuto - * @table wechat_auto - * @return void - */ - private function _create_wechat_auto() { - - // 当前数据表 - $table = 'wechat_auto'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-回复', - ]) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '类型(text,image,news)']) - ->addColumn('time','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '延迟时间']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '消息编号']) - ->addColumn('appid','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '文本内容']) - ->addColumn('image_url','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '图片链接']) - ->addColumn('voice_url','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '语音链接']) - ->addColumn('music_title','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '音乐标题']) - ->addColumn('music_url','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐链接']) - ->addColumn('music_image','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '缩略图片']) - ->addColumn('music_desc','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐描述']) - ->addColumn('video_title','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '视频标题']) - ->addColumn('video_url','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频URL']) - ->addColumn('video_desc','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频描述']) - ->addColumn('news_id','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '图文ID']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']) - ->addColumn('create_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->addIndex('code', ['name' => 'i15cee0aa7_code']) - ->addIndex('type', ['name' => 'i15cee0aa7_type']) - ->addIndex('time', ['name' => 'i15cee0aa7_time']) - ->addIndex('appid', ['name' => 'i15cee0aa7_appid']) - ->addIndex('status', ['name' => 'i15cee0aa7_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class WechatFans - * @table wechat_fans - * @return void - */ - private function _create_wechat_fans() { - - // 当前数据表 - $table = 'wechat_fans'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-粉丝', - ]) - ->addColumn('appid','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) - ->addColumn('unionid','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝unionid']) - ->addColumn('openid','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝openid']) - ->addColumn('tagid_list','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝标签id']) - ->addColumn('is_black','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否为黑名单状态']) - ->addColumn('subscribe','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '关注状态(0未关注,1已关注)']) - ->addColumn('nickname','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '用户昵称']) - ->addColumn('sex','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '用户性别(1男性,2女性,0未知)']) - ->addColumn('country','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在国家']) - ->addColumn('province','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在省份']) - ->addColumn('city','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在城市']) - ->addColumn('language','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户的语言(zh_CN)']) - ->addColumn('headimgurl','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']) - ->addColumn('subscribe_time','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '关注时间']) - ->addColumn('subscribe_at','datetime',['default' => NULL, 'null' => true, 'comment' => '关注时间']) - ->addColumn('remark','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '备注']) - ->addColumn('subscribe_scene','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '扫码关注场景']) - ->addColumn('qr_scene','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '二维码场景值']) - ->addColumn('qr_scene_str','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '二维码场景内容']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->addIndex('appid', ['name' => 'ic99bc7baf_appid']) - ->addIndex('openid', ['name' => 'ic99bc7baf_openid']) - ->addIndex('unionid', ['name' => 'ic99bc7baf_unionid']) - ->addIndex('is_black', ['name' => 'ic99bc7baf_is_black']) - ->addIndex('subscribe', ['name' => 'ic99bc7baf_subscribe']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class WechatFansTags - * @table wechat_fans_tags - * @return void - */ - private function _create_wechat_fans_tags() { - - // 当前数据表 - $table = 'wechat_fans_tags'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-标签', - ]) - ->addColumn('appid','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) - ->addColumn('name','string',['limit' => 35, 'default' => '', 'null' => true, 'comment' => '标签名称']) - ->addColumn('count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '粉丝总数']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建日期']) - ->addIndex('id', ['name' => 'i1e2a8a9a3_id']) - ->addIndex('appid', ['name' => 'i1e2a8a9a3_appid']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class WechatKeys - * @table wechat_keys - * @return void - */ - private function _create_wechat_keys() { - - // 当前数据表 - $table = 'wechat_keys'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-规则', - ]) - ->addColumn('appid','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '类型(text,image,news)']) - ->addColumn('keys','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '关键字']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '文本内容']) - ->addColumn('image_url','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '图片链接']) - ->addColumn('voice_url','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '语音链接']) - ->addColumn('music_title','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '音乐标题']) - ->addColumn('music_url','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐链接']) - ->addColumn('music_image','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '缩略图片']) - ->addColumn('music_desc','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐描述']) - ->addColumn('video_title','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '视频标题']) - ->addColumn('video_url','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频URL']) - ->addColumn('video_desc','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频描述']) - ->addColumn('news_id','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '图文ID']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序字段']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']) - ->addColumn('create_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->addIndex('type', ['name' => 'i23d2c7f47_type']) - ->addIndex('keys', ['name' => 'i23d2c7f47_keys']) - ->addIndex('sort', ['name' => 'i23d2c7f47_sort']) - ->addIndex('appid', ['name' => 'i23d2c7f47_appid']) - ->addIndex('status', ['name' => 'i23d2c7f47_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class WechatMedia - * @table wechat_media - * @return void - */ - private function _create_wechat_media() { - - // 当前数据表 - $table = 'wechat_media'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-素材', - ]) - ->addColumn('md5','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '文件哈希']) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '媒体类型']) - ->addColumn('appid','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号ID']) - ->addColumn('media_id','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '永久素材MediaID']) - ->addColumn('local_url','string',['limit' => 300, 'default' => '', 'null' => true, 'comment' => '本地文件链接']) - ->addColumn('media_url','string',['limit' => 300, 'default' => '', 'null' => true, 'comment' => '远程图片链接']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->addIndex('md5', ['name' => 'i7f6418618_md5']) - ->addIndex('type', ['name' => 'i7f6418618_type']) - ->addIndex('appid', ['name' => 'i7f6418618_appid']) - ->addIndex('media_id', ['name' => 'i7f6418618_media_id']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class WechatNews - * @table wechat_news - * @return void - */ - private function _create_wechat_news() { - - // 当前数据表 - $table = 'wechat_news'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-图文', - ]) - ->addColumn('media_id','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '永久素材MediaID']) - ->addColumn('local_url','string',['limit' => 300, 'default' => '', 'null' => true, 'comment' => '永久素材外网URL']) - ->addColumn('article_id','string',['limit' => 60, 'default' => '', 'null' => true, 'comment' => '关联图文ID(用英文逗号做分割)']) - ->addColumn('is_deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->addColumn('create_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']) - ->addIndex('media_id', ['name' => 'ib3c69027e_media_id']) - ->addIndex('article_id', ['name' => 'ib3c69027e_article_id']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class WechatNewsArticle - * @table wechat_news_article - * @return void - */ - private function _create_wechat_news_article() { - - // 当前数据表 - $table = 'wechat_news_article'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-文章', - ]) - ->addColumn('title','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '素材标题']) - ->addColumn('local_url','string',['limit' => 300, 'default' => '', 'null' => true, 'comment' => '永久素材URL']) - ->addColumn('show_cover_pic','integer',['limit' => 4, 'default' => 0, 'null' => true, 'comment' => '显示封面(0不显示,1显示)']) - ->addColumn('author','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '文章作者']) - ->addColumn('digest','string',['limit' => 300, 'default' => '', 'null' => true, 'comment' => '摘要内容']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '图文内容']) - ->addColumn('content_source_url','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '原文地址']) - ->addColumn('read_num','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '阅读数量']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class WechatPaymentRecord - * @table wechat_payment_record - * @return void - */ - private function _create_wechat_payment_record() { - - // 当前数据表 - $table = 'wechat_payment_record'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-支付-行为', - ]) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '交易方式']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '发起支付号']) - ->addColumn('appid','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '发起APPID']) - ->addColumn('openid','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户OPENID']) - ->addColumn('order_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '原订单编号']) - ->addColumn('order_name','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '原订单标题']) - ->addColumn('order_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '原订单金额']) - ->addColumn('payment_time','datetime',['default' => NULL, 'null' => true, 'comment' => '支付完成时间']) - ->addColumn('payment_trade','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '平台交易编号']) - ->addColumn('payment_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态(0未付,1已付,2取消)']) - ->addColumn('payment_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际到账金额']) - ->addColumn('payment_bank','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '支付银行类型']) - ->addColumn('payment_notify','text',['default' => NULL, 'null' => true, 'comment' => '支付结果通知']) - ->addColumn('payment_remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '支付状态备注']) - ->addColumn('refund_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '退款状态(0未退,1已退)']) - ->addColumn('refund_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退款金额']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('type', ['name' => 'i43926536a_type']) - ->addIndex('code', ['name' => 'i43926536a_code']) - ->addIndex('appid', ['name' => 'i43926536a_appid']) - ->addIndex('openid', ['name' => 'i43926536a_openid']) - ->addIndex('order_code', ['name' => 'i43926536a_order_code']) - ->addIndex('create_time', ['name' => 'i43926536a_create_time']) - ->addIndex('payment_trade', ['name' => 'i43926536a_payment_trade']) - ->addIndex('payment_status', ['name' => 'i43926536a_payment_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class WechatPaymentRefund - * @table wechat_payment_refund - * @return void - */ - private function _create_wechat_payment_refund() { - - // 当前数据表 - $table = 'wechat_payment_refund'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-支付-退款', - ]) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '发起支付号']) - ->addColumn('record_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '子支付编号']) - ->addColumn('refund_time','datetime',['default' => NULL, 'null' => true, 'comment' => '支付完成时间']) - ->addColumn('refund_trade','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '平台交易编号']) - ->addColumn('refund_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态(0未付,1已付,2取消)']) - ->addColumn('refund_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际到账金额']) - ->addColumn('refund_account','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '退款目标账号']) - ->addColumn('refund_scode','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '退款状态码']) - ->addColumn('refund_remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '支付状态备注']) - ->addColumn('refund_notify','text',['default' => NULL, 'null' => true, 'comment' => '退款交易通知']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'i5a815074f_code']) - ->addIndex('record_code', ['name' => 'i5a815074f_record_code']) - ->addIndex('create_time', ['name' => 'i5a815074f_create_time']) - ->addIndex('refund_trade', ['name' => 'i5a815074f_refund_trade']) - ->addIndex('refund_status', ['name' => 'i5a815074f_refund_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - -} diff --git a/database/migrations/20009999999966_install_system_table.php b/database/migrations/20009999999966_install_system_table.php deleted file mode 100644 index d9c6bc674..000000000 --- a/database/migrations/20009999999966_install_system_table.php +++ /dev/null @@ -1,396 +0,0 @@ -_create_system_auth(); - $this->_create_system_auth_node(); - $this->_create_system_base(); - $this->_create_system_config(); - $this->_create_system_data(); - $this->_create_system_file(); - $this->_create_system_menu(); - $this->_create_system_oplog(); - $this->_create_system_queue(); - $this->_create_system_user(); - - } - - /** - * 创建数据对象 - * @class SystemAuth - * @table system_auth - * @return void - */ - private function _create_system_auth() { - - // 当前数据表 - $table = 'system_auth'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-权限', - ]) - ->addColumn('title','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '权限名称']) - ->addColumn('utype','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '身份权限']) - ->addColumn('desc','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '备注说明']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '权限状态(1使用,0禁用)']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->addIndex('sort', ['name' => 'i73a781d61_sort']) - ->addIndex('title', ['name' => 'i73a781d61_title']) - ->addIndex('status', ['name' => 'i73a781d61_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class SystemAuthNode - * @table system_auth_node - * @return void - */ - private function _create_system_auth_node() { - - // 当前数据表 - $table = 'system_auth_node'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-授权', - ]) - ->addColumn('auth','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '角色']) - ->addColumn('node','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '节点']) - ->addIndex('auth', ['name' => 'i4cd9aaff6_auth']) - ->addIndex('node', ['name' => 'i4cd9aaff6_node']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class SystemBase - * @table system_base - * @return void - */ - private function _create_system_base() { - - // 当前数据表 - $table = 'system_base'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-字典', - ]) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '数据类型']) - ->addColumn('code','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '数据代码']) - ->addColumn('name','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '数据名称']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '数据内容']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '数据状态(0禁用,1启动)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0正常,1已删)']) - ->addColumn('deleted_at','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '删除时间']) - ->addColumn('deleted_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '删除用户']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->addIndex('type', ['name' => 'i2a29c450f_type']) - ->addIndex('code', ['name' => 'i2a29c450f_code']) - ->addIndex('name', ['name' => 'i2a29c450f_name']) - ->addIndex('sort', ['name' => 'i2a29c450f_sort']) - ->addIndex('status', ['name' => 'i2a29c450f_status']) - ->addIndex('deleted', ['name' => 'i2a29c450f_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class SystemConfig - * @table system_config - * @return void - */ - private function _create_system_config() { - - // 当前数据表 - $table = 'system_config'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-配置', - ]) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配置分类']) - ->addColumn('name','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '配置名称']) - ->addColumn('value','string',['limit' => 2048, 'default' => '', 'null' => true, 'comment' => '配置内容']) - ->addIndex('type', ['name' => 'i48e345b98_type']) - ->addIndex('name', ['name' => 'i48e345b98_name']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class SystemData - * @table system_data - * @return void - */ - private function _create_system_data() { - - // 当前数据表 - $table = 'system_data'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-数据', - ]) - ->addColumn('name','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '配置名']) - ->addColumn('value','text',['default' => NULL, 'null' => true, 'comment' => '配置值']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('name', ['name' => 'icbccedc16_name']) - ->addIndex('create_time', ['name' => 'icbccedc16_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class SystemFile - * @table system_file - * @return void - */ - private function _create_system_file() { - - // 当前数据表 - $table = 'system_file'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-文件', - ]) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '上传类型']) - ->addColumn('hash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '文件哈希']) - ->addColumn('tags','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '文件标签']) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '文件名称']) - ->addColumn('xext','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '文件后缀']) - ->addColumn('xurl','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '访问链接']) - ->addColumn('xkey','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '文件路径']) - ->addColumn('mime','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '文件类型']) - ->addColumn('size','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文件大小']) - ->addColumn('uuid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '会员编号']) - ->addColumn('isfast','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否秒传']) - ->addColumn('issafe','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '安全模式']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '上传状态(1悬空,2落地)']) - ->addColumn('create_at','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_at','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('type', ['name' => 'i738a363ca_type']) - ->addIndex('hash', ['name' => 'i738a363ca_hash']) - ->addIndex('uuid', ['name' => 'i738a363ca_uuid']) - ->addIndex('xext', ['name' => 'i738a363ca_xext']) - ->addIndex('unid', ['name' => 'i738a363ca_unid']) - ->addIndex('tags', ['name' => 'i738a363ca_tags']) - ->addIndex('name', ['name' => 'i738a363ca_name']) - ->addIndex('status', ['name' => 'i738a363ca_status']) - ->addIndex('issafe', ['name' => 'i738a363ca_issafe']) - ->addIndex('isfast', ['name' => 'i738a363ca_isfast']) - ->addIndex('create_at', ['name' => 'i738a363ca_create_at']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class SystemMenu - * @table system_menu - * @return void - */ - private function _create_system_menu() { - - // 当前数据表 - $table = 'system_menu'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-菜单', - ]) - ->addColumn('pid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级ID']) - ->addColumn('title','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '菜单名称']) - ->addColumn('icon','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '菜单图标']) - ->addColumn('node','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '节点代码']) - ->addColumn('url','string',['limit' => 400, 'default' => '', 'null' => true, 'comment' => '链接节点']) - ->addColumn('params','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '链接参数']) - ->addColumn('target','string',['limit' => 20, 'default' => '_self', 'null' => true, 'comment' => '打开方式']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0:禁用,1:启用)']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->addIndex('pid', ['name' => 'i29b9da675_pid']) - ->addIndex('sort', ['name' => 'i29b9da675_sort']) - ->addIndex('status', ['name' => 'i29b9da675_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class SystemOplog - * @table system_oplog - * @return void - */ - private function _create_system_oplog() { - - // 当前数据表 - $table = 'system_oplog'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-日志', - ]) - ->addColumn('node','string',['limit' => 200, 'default' => '', 'null' => false, 'comment' => '当前操作节点']) - ->addColumn('geoip','string',['limit' => 15, 'default' => '', 'null' => false, 'comment' => '操作者IP地址']) - ->addColumn('action','string',['limit' => 200, 'default' => '', 'null' => false, 'comment' => '操作行为名称']) - ->addColumn('content','string',['limit' => 1024, 'default' => '', 'null' => false, 'comment' => '操作内容描述']) - ->addColumn('username','string',['limit' => 50, 'default' => '', 'null' => false, 'comment' => '操作人用户名']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '创建时间']) - ->addIndex('create_at', ['name' => 'id7cb1c775_create_at']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class SystemQueue - * @table system_queue - * @return void - */ - private function _create_system_queue() { - - // 当前数据表 - $table = 'system_queue'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-任务', - ]) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => false, 'comment' => '任务编号']) - ->addColumn('title','string',['limit' => 100, 'default' => '', 'null' => false, 'comment' => '任务名称']) - ->addColumn('command','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '执行指令']) - ->addColumn('exec_pid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行进程']) - ->addColumn('exec_data','text',['default' => NULL, 'null' => true, 'comment' => '执行参数']) - ->addColumn('exec_time','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行时间']) - ->addColumn('exec_desc','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '执行描述']) - ->addColumn('enter_time','decimal',['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '开始时间']) - ->addColumn('outer_time','decimal',['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '结束时间']) - ->addColumn('loops_time','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '循环时间']) - ->addColumn('attempts','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行次数']) - ->addColumn('message','text',['default' => NULL, 'null' => true, 'comment' => '最新消息']) - ->addColumn('rscript','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '任务类型(0单例,1多例)']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '任务状态(1新任务,2处理中,3成功,4失败)']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '创建时间']) - ->addIndex('code', ['name' => 'if64376974_code']) - ->addIndex('title', ['name' => 'if64376974_title']) - ->addIndex('status', ['name' => 'if64376974_status']) - ->addIndex('rscript', ['name' => 'if64376974_rscript']) - ->addIndex('create_at', ['name' => 'if64376974_create_at']) - ->addIndex('exec_time', ['name' => 'if64376974_exec_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class SystemUser - * @table system_user - * @return void - */ - private function _create_system_user() { - - // 当前数据表 - $table = 'system_user'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-用户', - ]) - ->addColumn('usertype','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户类型']) - ->addColumn('username','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户账号']) - ->addColumn('password','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '用户密码']) - ->addColumn('nickname','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户昵称']) - ->addColumn('headimg','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '头像地址']) - ->addColumn('authorize','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '权限授权']) - ->addColumn('contact_qq','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系QQ']) - ->addColumn('contact_mail','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系邮箱']) - ->addColumn('contact_phone','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系手机']) - ->addColumn('login_ip','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '登录地址']) - ->addColumn('login_at','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '登录时间']) - ->addColumn('login_num','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '登录次数']) - ->addColumn('describe','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '备注说明']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']) - ->addColumn('is_deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除(1删除,0未删)']) - ->addColumn('create_at','timestamp',['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) - ->addIndex('sort', ['name' => 'i34b957835_sort']) - ->addIndex('status', ['name' => 'i34b957835_status']) - ->addIndex('username', ['name' => 'i34b957835_username']) - ->addIndex('is_deleted', ['name' => 'i34b957835_is_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - -} diff --git a/database/migrations/20009999999967_install_wemall_table.php b/database/migrations/20009999999967_install_wemall_table.php deleted file mode 100644 index 8bb1b9715..000000000 --- a/database/migrations/20009999999967_install_wemall_table.php +++ /dev/null @@ -1,1616 +0,0 @@ -_create_plugin_wemall_config_agent(); - $this->_create_plugin_wemall_config_coupon(); - $this->_create_plugin_wemall_config_discount(); - $this->_create_plugin_wemall_config_level(); - $this->_create_plugin_wemall_config_notify(); - $this->_create_plugin_wemall_config_poster(); - $this->_create_plugin_wemall_config_rebate(); - $this->_create_plugin_wemall_express_company(); - $this->_create_plugin_wemall_express_template(); - $this->_create_plugin_wemall_goods(); - $this->_create_plugin_wemall_goods_cate(); - $this->_create_plugin_wemall_goods_item(); - $this->_create_plugin_wemall_goods_mark(); - $this->_create_plugin_wemall_goods_stock(); - $this->_create_plugin_wemall_help_feedback(); - $this->_create_plugin_wemall_help_problem(); - $this->_create_plugin_wemall_help_question(); - $this->_create_plugin_wemall_help_question_x(); - $this->_create_plugin_wemall_order(); - $this->_create_plugin_wemall_order_cart(); - $this->_create_plugin_wemall_order_item(); - $this->_create_plugin_wemall_order_refund(); - $this->_create_plugin_wemall_order_sender(); - $this->_create_plugin_wemall_user_action_collect(); - $this->_create_plugin_wemall_user_action_comment(); - $this->_create_plugin_wemall_user_action_history(); - $this->_create_plugin_wemall_user_action_search(); - $this->_create_plugin_wemall_user_checkin(); - $this->_create_plugin_wemall_user_coupon(); - $this->_create_plugin_wemall_user_create(); - $this->_create_plugin_wemall_user_rebate(); - $this->_create_plugin_wemall_user_recharge(); - $this->_create_plugin_wemall_user_relation(); - $this->_create_plugin_wemall_user_transfer(); - - } - - /** - * 创建数据对象 - * @class PluginWemallConfigAgent - * @table plugin_wemall_config_agent - * @return void - */ - private function _create_plugin_wemall_config_agent() { - - // 当前数据表 - $table = 'plugin_wemall_config_agent'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-等级', - ]) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '级别名称']) - ->addColumn('cover','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '等级图标']) - ->addColumn('cardbg','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '等级卡片']) - ->addColumn('number','integer',['limit' => 2, 'default' => 0, 'null' => true, 'comment' => '级别序号']) - ->addColumn('upgrade_type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '升级规则(0单个,1同时)']) - ->addColumn('extra','text',['default' => NULL, 'null' => true, 'comment' => '升级规则']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '级别描述']) - ->addColumn('utime','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '更新时间']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '等级状态(1使用,0禁用)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('utime', ['name' => 'i6a80c4b9e_utime']) - ->addIndex('status', ['name' => 'i6a80c4b9e_status']) - ->addIndex('number', ['name' => 'i6a80c4b9e_number']) - ->addIndex('create_time', ['name' => 'i6a80c4b9e_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallConfigCoupon - * @table plugin_wemall_config_coupon - * @return void - */ - private function _create_plugin_wemall_config_coupon() { - - // 当前数据表 - $table = 'plugin_wemall_config_coupon'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-卡券', - ]) - ->addColumn('type','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '类型(0通用券,1商品券)']) - ->addColumn('name','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '优惠名称']) - ->addColumn('cover','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '封面图标']) - ->addColumn('extra','text',['default' => NULL, 'null' => true, 'comment' => '扩展数据']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '内容描述']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '系统备注']) - ->addColumn('amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '抵扣金额']) - ->addColumn('limit_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '金额门槛(0不限制)']) - ->addColumn('limit_levels','string',['limit' => 180, 'default' => '-', 'null' => true, 'comment' => '授权等级']) - ->addColumn('limit_times','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '限领数量(0不限制)']) - ->addColumn('expire_days','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '有效天数']) - ->addColumn('total_stock','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '库存数量']) - ->addColumn('total_sales','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '发放数量']) - ->addColumn('total_used','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '使用数量']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '卡券状态(0禁用,1使用)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('sort', ['name' => 'ibfe2b6128_sort']) - ->addIndex('type', ['name' => 'ibfe2b6128_type']) - ->addIndex('status', ['name' => 'ibfe2b6128_status']) - ->addIndex('deleted', ['name' => 'ibfe2b6128_deleted']) - ->addIndex('create_time', ['name' => 'ibfe2b6128_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallConfigDiscount - * @table plugin_wemall_config_discount - * @return void - */ - private function _create_plugin_wemall_config_discount() { - - // 当前数据表 - $table = 'plugin_wemall_config_discount'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-折扣', - ]) - ->addColumn('name','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '方案名称']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '方案描述']) - ->addColumn('items','text',['default' => NULL, 'null' => true, 'comment' => '方案规则']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '方案状态(0禁用,1使用)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('sort', ['name' => 'i8d0e0158e_sort']) - ->addIndex('status', ['name' => 'i8d0e0158e_status']) - ->addIndex('deleted', ['name' => 'i8d0e0158e_deleted']) - ->addIndex('create_time', ['name' => 'i8d0e0158e_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallConfigLevel - * @table plugin_wemall_config_level - * @return void - */ - private function _create_plugin_wemall_config_level() { - - // 当前数据表 - $table = 'plugin_wemall_config_level'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-等级', - ]) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '级别名称']) - ->addColumn('cover','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '等级图标']) - ->addColumn('cardbg','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '等级卡片']) - ->addColumn('number','integer',['limit' => 2, 'default' => 0, 'null' => true, 'comment' => '级别序号']) - ->addColumn('upgrade_type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '升级规则(0单个,1同时)']) - ->addColumn('upgrade_team','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '团队人数统计(0不计,1累计)']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户级别描述']) - ->addColumn('extra','text',['default' => NULL, 'null' => true, 'comment' => '配置规则']) - ->addColumn('utime','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '更新时间']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '等级状态(1使用,0禁用)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('utime', ['name' => 'if851bb0b1_utime']) - ->addIndex('status', ['name' => 'if851bb0b1_status']) - ->addIndex('number', ['name' => 'if851bb0b1_number']) - ->addIndex('create_time', ['name' => 'if851bb0b1_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallConfigNotify - * @table plugin_wemall_config_notify - * @return void - */ - private function _create_plugin_wemall_config_notify() { - - // 当前数据表 - $table = 'plugin_wemall_config_notify'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-通知', - ]) - ->addColumn('code','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '通知编号']) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '通知标题']) - ->addColumn('cover','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '通知图片']) - ->addColumn('levels','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户等级']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '通知内容']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '通知描述']) - ->addColumn('num_read','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '阅读次数']) - ->addColumn('tips','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => 'TIPS显示']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '激活状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'i0614c3468_code']) - ->addIndex('sort', ['name' => 'i0614c3468_sort']) - ->addIndex('name', ['name' => 'i0614c3468_name']) - ->addIndex('tips', ['name' => 'i0614c3468_tips']) - ->addIndex('status', ['name' => 'i0614c3468_status']) - ->addIndex('deleted', ['name' => 'i0614c3468_deleted']) - ->addIndex('create_time', ['name' => 'i0614c3468_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallConfigPoster - * @table plugin_wemall_config_poster - * @return void - */ - private function _create_plugin_wemall_config_poster() { - - // 当前数据表 - $table = 'plugin_wemall_config_poster'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-海报', - ]) - ->addColumn('code','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '推广编号']) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '推广标题']) - ->addColumn('levels','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户等级']) - ->addColumn('devices','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '接口通道']) - ->addColumn('image','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '推广图片']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '二维位置']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '推广描述']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '激活状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'ib84148924_code']) - ->addIndex('sort', ['name' => 'ib84148924_sort']) - ->addIndex('name', ['name' => 'ib84148924_name']) - ->addIndex('status', ['name' => 'ib84148924_status']) - ->addIndex('deleted', ['name' => 'ib84148924_deleted']) - ->addIndex('create_time', ['name' => 'ib84148924_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallConfigRebate - * @table plugin_wemall_config_rebate - * @return void - */ - private function _create_plugin_wemall_config_rebate() { - - // 当前数据表 - $table = 'plugin_wemall_config_rebate'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-返利', - ]) - ->addColumn('type','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '奖励类型']) - ->addColumn('code','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '配置编号']) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '配置名称']) - ->addColumn('path','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '等级关系']) - ->addColumn('stype','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '结算类型(0支付结算,1收货结算)']) - ->addColumn('p0_level','biginteger',['limit' => 20, 'default' => -1, 'null' => true, 'comment' => '会员等级']) - ->addColumn('p1_level','biginteger',['limit' => 20, 'default' => -1, 'null' => true, 'comment' => '上1级等级']) - ->addColumn('p2_level','biginteger',['limit' => 20, 'default' => -1, 'null' => true, 'comment' => '上2级等级']) - ->addColumn('p3_level','biginteger',['limit' => 20, 'default' => -1, 'null' => true, 'comment' => '上3级等级']) - ->addColumn('p0_reward_type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '会员计算类型(0固定金额,1交易比例,2利润比例)']) - ->addColumn('p0_reward_number','decimal',['precision' => 20, 'scale' => 6, 'default' => '0.000000', 'null' => true, 'comment' => '会员计算系数']) - ->addColumn('p1_reward_type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '上1级计算类型(0固定金额,1交易比例,2利润比例)']) - ->addColumn('p1_reward_number','decimal',['precision' => 20, 'scale' => 6, 'default' => '0.000000', 'null' => true, 'comment' => '上1级计算系数']) - ->addColumn('p2_reward_type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '上2级计算类型(0固定金额,1交易比例,2利润比例)']) - ->addColumn('p2_reward_number','decimal',['precision' => 20, 'scale' => 6, 'default' => '0.000000', 'null' => true, 'comment' => '上2级计算系数']) - ->addColumn('p3_reward_type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '上3级计算类型(0固定金额,1交易比例,2利润比例)']) - ->addColumn('p3_reward_number','decimal',['precision' => 20, 'scale' => 6, 'default' => '0.000000', 'null' => true, 'comment' => '上3级计算系数']) - ->addColumn('remark','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '配置描述']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '激活状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'i3a0d023e7_code']) - ->addIndex('sort', ['name' => 'i3a0d023e7_sort']) - ->addIndex('name', ['name' => 'i3a0d023e7_name']) - ->addIndex('type', ['name' => 'i3a0d023e7_type']) - ->addIndex('stype', ['name' => 'i3a0d023e7_stype']) - ->addIndex('status', ['name' => 'i3a0d023e7_status']) - ->addIndex('deleted', ['name' => 'i3a0d023e7_deleted']) - ->addIndex('p1_level', ['name' => 'i3a0d023e7_p1_level']) - ->addIndex('p2_level', ['name' => 'i3a0d023e7_p2_level']) - ->addIndex('p3_level', ['name' => 'i3a0d023e7_p3_level']) - ->addIndex('p0_level', ['name' => 'i3a0d023e7_p0_level']) - ->addIndex('create_time', ['name' => 'i3a0d023e7_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallExpressCompany - * @table plugin_wemall_express_company - * @return void - */ - private function _create_plugin_wemall_express_company() { - - // 当前数据表 - $table = 'plugin_wemall_express_company'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-公司', - ]) - ->addColumn('code','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公司代码']) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '公司名称']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '公司描述']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '激活状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'ia20ef923b_code']) - ->addIndex('sort', ['name' => 'ia20ef923b_sort']) - ->addIndex('name', ['name' => 'ia20ef923b_name']) - ->addIndex('status', ['name' => 'ia20ef923b_status']) - ->addIndex('deleted', ['name' => 'ia20ef923b_deleted']) - ->addIndex('create_time', ['name' => 'ia20ef923b_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallExpressTemplate - * @table plugin_wemall_express_template - * @return void - */ - private function _create_plugin_wemall_express_template() { - - // 当前数据表 - $table = 'plugin_wemall_express_template'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-模板', - ]) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '模板编号']) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '模板名称']) - ->addColumn('normal','text',['default' => NULL, 'null' => true, 'comment' => '默认规则']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '模板规则']) - ->addColumn('company','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '快递公司']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '激活状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'i415af662e_code']) - ->addIndex('sort', ['name' => 'i415af662e_sort']) - ->addIndex('name', ['name' => 'i415af662e_name']) - ->addIndex('status', ['name' => 'i415af662e_status']) - ->addIndex('deleted', ['name' => 'i415af662e_deleted']) - ->addIndex('create_time', ['name' => 'i415af662e_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallGoods - * @table plugin_wemall_goods - * @return void - */ - private function _create_plugin_wemall_goods() { - - // 当前数据表 - $table = 'plugin_wemall_goods'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-内容', - ]) - ->addColumn('ssid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) - ->addColumn('name','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '商品名称']) - ->addColumn('marks','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品标签']) - ->addColumn('cates','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '分类编号']) - ->addColumn('cover','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品封面']) - ->addColumn('slider','text',['default' => NULL, 'null' => true, 'comment' => '轮播图片']) - ->addColumn('specs','text',['default' => NULL, 'null' => true, 'comment' => '商品规格(JSON)']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '商品详情']) - ->addColumn('remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品描述']) - ->addColumn('stock_total','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品库存统计']) - ->addColumn('stock_sales','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品销售统计']) - ->addColumn('stock_virtual','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品虚拟销量']) - ->addColumn('price_selling','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最低销售价格']) - ->addColumn('price_market','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最低市场价格']) - ->addColumn('allow_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大积分兑换']) - ->addColumn('allow_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大余额支付']) - ->addColumn('rebate_type','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '参与返利(0无需返利,1需要返利)']) - ->addColumn('delivery_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物流运费模板']) - ->addColumn('limit_lowvip','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '限制购买等级(0不限制,其他限制)']) - ->addColumn('limit_maxnum','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '最大购买数量(0不限制,其他限制)']) - ->addColumn('level_agent','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推广权益(0无,1有)']) - ->addColumn('level_upgrade','biginteger',['limit' => 20, 'default' => -1, 'null' => true, 'comment' => '购买升级等级(-1非入会,0不升级,其他升级)']) - ->addColumn('discount_id','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '折扣方案编号(0无折扣,其他折扣)']) - ->addColumn('num_read','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '访问阅读统计']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '列表排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态(1使用,0禁用)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'i175165940_code']) - ->addIndex('sort', ['name' => 'i175165940_sort']) - ->addIndex('ssid', ['name' => 'i175165940_ssid']) - ->addIndex('status', ['name' => 'i175165940_status']) - ->addIndex('deleted', ['name' => 'i175165940_deleted']) - ->addIndex('rebate_type', ['name' => 'i175165940_rebate_type']) - ->addIndex('discount_id', ['name' => 'i175165940_discount_id']) - ->addIndex('create_time', ['name' => 'i175165940_create_time']) - ->addIndex('level_agent', ['name' => 'i175165940_level_agent']) - ->addIndex('level_upgrade', ['name' => 'i175165940_level_upgrade']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallGoodsCate - * @table plugin_wemall_goods_cate - * @return void - */ - private function _create_plugin_wemall_goods_cate() { - - // 当前数据表 - $table = 'plugin_wemall_goods_cate'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-分类', - ]) - ->addColumn('pid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级分类']) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '分类名称']) - ->addColumn('cover','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '分类图标']) - ->addColumn('remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '分类描述']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '使用状态']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('pid', ['name' => 'i4e6868d55_pid']) - ->addIndex('sort', ['name' => 'i4e6868d55_sort']) - ->addIndex('status', ['name' => 'i4e6868d55_status']) - ->addIndex('deleted', ['name' => 'i4e6868d55_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallGoodsItem - * @table plugin_wemall_goods_item - * @return void - */ - private function _create_plugin_wemall_goods_item() { - - // 当前数据表 - $table = 'plugin_wemall_goods_item'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-规格', - ]) - ->addColumn('gsku','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品SKU']) - ->addColumn('ghash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈希']) - ->addColumn('gcode','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) - ->addColumn('gspec','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '商品规格']) - ->addColumn('gunit','string',['limit' => 10, 'default' => '件', 'null' => true, 'comment' => '商品单位']) - ->addColumn('gimage','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '商品图片']) - ->addColumn('stock_sales','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '销售数量']) - ->addColumn('stock_total','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品库存']) - ->addColumn('price_cost','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '进货成本']) - ->addColumn('price_selling','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '销售价格']) - ->addColumn('price_market','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '市场价格']) - ->addColumn('allow_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '兑换积分']) - ->addColumn('allow_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '余额支付']) - ->addColumn('reward_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励余额']) - ->addColumn('reward_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励积分']) - ->addColumn('number_virtual','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟销量']) - ->addColumn('number_express','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '计件系数']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('gcode', ['name' => 'i65942f6de_gcode']) - ->addIndex('gspec', ['name' => 'i65942f6de_gspec']) - ->addIndex('ghash', ['name' => 'i65942f6de_ghash']) - ->addIndex('status', ['name' => 'i65942f6de_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallGoodsMark - * @table plugin_wemall_goods_mark - * @return void - */ - private function _create_plugin_wemall_goods_mark() { - - // 当前数据表 - $table = 'plugin_wemall_goods_mark'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-标签', - ]) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '标签名称']) - ->addColumn('remark','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '标签描述']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '标签状态(1使用,0禁用)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('sort', ['name' => 'i4dc56e1a2_sort']) - ->addIndex('status', ['name' => 'i4dc56e1a2_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallGoodsStock - * @table plugin_wemall_goods_stock - * @return void - */ - private function _create_plugin_wemall_goods_stock() { - - // 当前数据表 - $table = 'plugin_wemall_goods_stock'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-库存', - ]) - ->addColumn('batch_no','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作批量']) - ->addColumn('ghash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈希']) - ->addColumn('gcode','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) - ->addColumn('gspec','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商品规格']) - ->addColumn('gstock','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '入库数量']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '数据状态(1使用,0禁用)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('ghash', ['name' => 'ie71188985_ghash']) - ->addIndex('gcode', ['name' => 'ie71188985_gcode']) - ->addIndex('status', ['name' => 'ie71188985_status']) - ->addIndex('deleted', ['name' => 'ie71188985_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallHelpFeedback - * @table plugin_wemall_help_feedback - * @return void - */ - private function _create_plugin_wemall_help_feedback() { - - // 当前数据表 - $table = 'plugin_wemall_help_feedback'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-意见-反馈', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '反馈用户']) - ->addColumn('phone','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系电话']) - ->addColumn('images','text',['default' => NULL, 'null' => true, 'comment' => '反馈图片']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '反馈内容']) - ->addColumn('reply','text',['default' => NULL, 'null' => true, 'comment' => '回复内容']) - ->addColumn('reply_st','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '回复状态']) - ->addColumn('reply_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '回复用户']) - ->addColumn('reply_time','datetime',['default' => NULL, 'null' => true, 'comment' => '回复时间']) - ->addColumn('sync','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '同步至常见问题状态(1已同步,0未同步)']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '展示状态(1使用,0禁用)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('sort', ['name' => 'i7fa1b82bf_sort']) - ->addIndex('unid', ['name' => 'i7fa1b82bf_unid']) - ->addIndex('status', ['name' => 'i7fa1b82bf_status']) - ->addIndex('deleted', ['name' => 'i7fa1b82bf_deleted']) - ->addIndex('reply_st', ['name' => 'i7fa1b82bf_reply_st']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallHelpProblem - * @table plugin_wemall_help_problem - * @return void - */ - private function _create_plugin_wemall_help_problem() { - - // 当前数据表 - $table = 'plugin_wemall_help_problem'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-常见-问题', - ]) - ->addColumn('fid','biginteger',['limit' => 20, 'default' => 0, 'null' => false, 'comment' => '来自反馈']) - ->addColumn('name','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '问题标题']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '问题内容']) - ->addColumn('num_er','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '未解决数']) - ->addColumn('num_ok','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '已解决数']) - ->addColumn('num_read','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '阅读次数']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '展示状态(1使用,0禁用)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('sort', ['name' => 'i2a4212540_sort']) - ->addIndex('status', ['name' => 'i2a4212540_status']) - ->addIndex('deleted', ['name' => 'i2a4212540_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallHelpQuestion - * @table plugin_wemall_help_question - * @return void - */ - private function _create_plugin_wemall_help_question() { - - // 当前数据表 - $table = 'plugin_wemall_help_question'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-问答-内容', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '提问用户']) - ->addColumn('name','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '工单标题']) - ->addColumn('phone','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '联系电话']) - ->addColumn('order_no','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '关联订单']) - ->addColumn('images','text',['default' => NULL, 'null' => true, 'comment' => '工单图片']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '工单描述']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '工单状态(0取消,1新工单,2后台回复,3前台回复,4已完结)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('sort', ['name' => 'i9383b2cca_sort']) - ->addIndex('name', ['name' => 'i9383b2cca_name']) - ->addIndex('unid', ['name' => 'i9383b2cca_unid']) - ->addIndex('phone', ['name' => 'i9383b2cca_phone']) - ->addIndex('status', ['name' => 'i9383b2cca_status']) - ->addIndex('deleted', ['name' => 'i9383b2cca_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallHelpQuestionX - * @table plugin_wemall_help_question_x - * @return void - */ - private function _create_plugin_wemall_help_question_x() { - - // 当前数据表 - $table = 'plugin_wemall_help_question_x'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-问答-评论', - ]) - ->addColumn('ccid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '目标编号']) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '文本内容']) - ->addColumn('images','text',['default' => NULL, 'null' => true, 'comment' => '图片内容']) - ->addColumn('reply_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '后台用户']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1待审核,2已审核)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('ccid', ['name' => 'i9180fa26f_ccid']) - ->addIndex('unid', ['name' => 'i9180fa26f_unid']) - ->addIndex('status', ['name' => 'i9180fa26f_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallOrder - * @table plugin_wemall_order - * @return void - */ - private function _create_plugin_wemall_order() { - - // 当前数据表 - $table = 'plugin_wemall_order'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-内容', - ]) - ->addColumn('ssid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) - ->addColumn('puid1','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上1级代理']) - ->addColumn('puid2','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上2级代理']) - ->addColumn('puid3','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上3级代理']) - ->addColumn('order_no','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']) - ->addColumn('order_ps','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '订单备注']) - ->addColumn('amount_cost','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品成本']) - ->addColumn('amount_real','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际金额']) - ->addColumn('amount_total','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单金额']) - ->addColumn('amount_goods','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品金额']) - ->addColumn('amount_profit','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '销售利润']) - ->addColumn('amount_reduct','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '随机减免']) - ->addColumn('amount_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '余额支付']) - ->addColumn('amount_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '积分抵扣']) - ->addColumn('amount_payment','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '金额支付']) - ->addColumn('amount_express','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '快递费用']) - ->addColumn('amount_discount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '折扣后金额']) - ->addColumn('coupon_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '优惠券编号']) - ->addColumn('coupon_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '优惠券金额']) - ->addColumn('allow_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大余额支付']) - ->addColumn('allow_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大积分抵扣']) - ->addColumn('ratio_integral','decimal',['precision' => 20, 'scale' => 6, 'default' => '0.000000', 'null' => true, 'comment' => '积分兑换比例']) - ->addColumn('number_goods','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品数量']) - ->addColumn('number_express','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计数']) - ->addColumn('level_agent','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '升级代理等级']) - ->addColumn('level_member','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '升级会员等级']) - ->addColumn('rebate_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '返利金额']) - ->addColumn('reward_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励余额']) - ->addColumn('reward_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励积分']) - ->addColumn('payment_time','datetime',['default' => NULL, 'null' => true, 'comment' => '支付时间']) - ->addColumn('payment_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态(0未支付,1有支付)']) - ->addColumn('payment_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际支付']) - ->addColumn('delivery_type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '物流类型(0无配送,1需配送)']) - ->addColumn('cancel_time','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '取消时间']) - ->addColumn('cancel_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '取消状态']) - ->addColumn('cancel_remark','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '取消描述']) - ->addColumn('deleted_time','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '删除时间']) - ->addColumn('deleted_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('deleted_remark','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '删除描述']) - ->addColumn('confirm_time','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '签收时间']) - ->addColumn('confirm_remark','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '签收描述']) - ->addColumn('refund_code','string',['limit' => 20, 'default' => NULL, 'null' => true, 'comment' => '售后单号']) - ->addColumn('refund_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '售后状态(0未售后,1预订单,2待审核,3待退货,4已退货,5待退款,6已退款,7已完成)']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '流程状态(0已取消,1预订单,2待支付,3待审核,4待发货,5已发货,6已收货,7已评论)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'i4914b9e88_unid']) - ->addIndex('ssid', ['name' => 'i4914b9e88_ssid']) - ->addIndex('puid1', ['name' => 'i4914b9e88_puid1']) - ->addIndex('puid2', ['name' => 'i4914b9e88_puid2']) - ->addIndex('puid3', ['name' => 'i4914b9e88_puid3']) - ->addIndex('status', ['name' => 'i4914b9e88_status']) - ->addIndex('order_no', ['name' => 'i4914b9e88_order_no']) - ->addIndex('create_time', ['name' => 'i4914b9e88_create_time']) - ->addIndex('refund_code', ['name' => 'i4914b9e88_refund_code']) - ->addIndex('coupon_code', ['name' => 'i4914b9e88_coupon_code']) - ->addIndex('delivery_type', ['name' => 'i4914b9e88_delivery_type']) - ->addIndex('cancel_status', ['name' => 'i4914b9e88_cancel_status']) - ->addIndex('refund_status', ['name' => 'i4914b9e88_refund_status']) - ->addIndex('deleted_status', ['name' => 'i4914b9e88_deleted_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallOrderCart - * @table plugin_wemall_order_cart - * @return void - */ - private function _create_plugin_wemall_order_cart() { - - // 当前数据表 - $table = 'plugin_wemall_order_cart'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-购物车', - ]) - ->addColumn('ssid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) - ->addColumn('ghash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '规格哈希']) - ->addColumn('gcode','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) - ->addColumn('gspec','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '商品规格']) - ->addColumn('number','biginteger',['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '商品数量']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'i75d9c8693_unid']) - ->addIndex('ssid', ['name' => 'i75d9c8693_ssid']) - ->addIndex('gcode', ['name' => 'i75d9c8693_gcode']) - ->addIndex('gspec', ['name' => 'i75d9c8693_gspec']) - ->addIndex('ghash', ['name' => 'i75d9c8693_ghash']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallOrderItem - * @table plugin_wemall_order_item - * @return void - */ - private function _create_plugin_wemall_order_item() { - - // 当前数据表 - $table = 'plugin_wemall_order_item'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-商品', - ]) - ->addColumn('ssid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) - ->addColumn('gsku','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品SKU']) - ->addColumn('ghash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈希']) - ->addColumn('gcode','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) - ->addColumn('gspec','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商品规格']) - ->addColumn('gunit','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商品单凭']) - ->addColumn('gname','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '商品名称']) - ->addColumn('gcover','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品封面']) - ->addColumn('order_no','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']) - ->addColumn('stock_sales','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '包含商品数量']) - ->addColumn('amount_cost','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品成本单价']) - ->addColumn('price_market','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品市场单价']) - ->addColumn('price_selling','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品销售单价']) - ->addColumn('total_price_cost','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品成本总价']) - ->addColumn('total_price_market','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品市场总价']) - ->addColumn('total_price_selling','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品销售总价']) - ->addColumn('total_allow_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大余额支付']) - ->addColumn('total_allow_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大兑换总分']) - ->addColumn('total_reward_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品奖励余额']) - ->addColumn('total_reward_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品奖励积分']) - ->addColumn('level_code','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户等级序号']) - ->addColumn('level_name','string',['limit' => 30, 'default' => '', 'null' => true, 'comment' => '用户等级名称']) - ->addColumn('level_agent','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推广权益(0无,1有)']) - ->addColumn('level_upgrade','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '购买升级等级(-1非入会,0不升级,其他升级)']) - ->addColumn('rebate_type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '参与返利状态(0不返,1返利)']) - ->addColumn('rebate_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '参与返利金额']) - ->addColumn('delivery_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递邮费模板']) - ->addColumn('delivery_count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计费基数']) - ->addColumn('discount_id','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '优惠方案编号']) - ->addColumn('discount_rate','decimal',['precision' => 20, 'scale' => 6, 'default' => '100.000000', 'null' => true, 'comment' => '销售价格折扣']) - ->addColumn('discount_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品优惠金额']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态(1使用,0禁用)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'i16a8905b9_unid']) - ->addIndex('gsku', ['name' => 'i16a8905b9_gsku']) - ->addIndex('ssid', ['name' => 'i16a8905b9_ssid']) - ->addIndex('gcode', ['name' => 'i16a8905b9_gcode']) - ->addIndex('gspec', ['name' => 'i16a8905b9_gspec']) - ->addIndex('ghash', ['name' => 'i16a8905b9_ghash']) - ->addIndex('status', ['name' => 'i16a8905b9_status']) - ->addIndex('deleted', ['name' => 'i16a8905b9_deleted']) - ->addIndex('order_no', ['name' => 'i16a8905b9_order_no']) - ->addIndex('rebate_type', ['name' => 'i16a8905b9_rebate_type']) - ->addIndex('discount_id', ['name' => 'i16a8905b9_discount_id']) - ->addIndex('level_agent', ['name' => 'i16a8905b9_level_agent']) - ->addIndex('delivery_code', ['name' => 'i16a8905b9_delivery_code']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallOrderRefund - * @table plugin_wemall_order_refund - * @return void - */ - private function _create_plugin_wemall_order_refund() { - - // 当前数据表 - $table = 'plugin_wemall_order_refund'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-售后', - ]) - ->addColumn('ssid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) - ->addColumn('type','biginteger',['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '申请类型(1退货退款,2仅退款)']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '售后单号']) - ->addColumn('order_no','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']) - ->addColumn('reason','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '退款原因']) - ->addColumn('number','biginteger',['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '退货数量']) - ->addColumn('amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '申请金额']) - ->addColumn('payment_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退款支付']) - ->addColumn('balance_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退款余额']) - ->addColumn('integral_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退款积分']) - ->addColumn('payment_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '退款单号']) - ->addColumn('balance_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '退回单号']) - ->addColumn('integral_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '退回单号']) - ->addColumn('phone','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系电话']) - ->addColumn('images','text',['default' => NULL, 'null' => true, 'comment' => '申请图片']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '申请说明']) - ->addColumn('remark','string',['limit' => 180, 'default' => NULL, 'null' => true, 'comment' => '操作描述']) - ->addColumn('express_no','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递单号']) - ->addColumn('express_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递公司']) - ->addColumn('express_name','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '快递名称']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '流程状态(0已取消,1预订单,2待审核,3待退货,4已退货,5待退款,6已退款,7已完成)']) - ->addColumn('status_at','datetime',['default' => NULL, 'null' => true, 'comment' => '状态变更时间']) - ->addColumn('status_ds','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '状态变更描述']) - ->addColumn('admin_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '后台用户']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'i3c826a8cd_unid']) - ->addIndex('type', ['name' => 'i3c826a8cd_type']) - ->addIndex('code', ['name' => 'i3c826a8cd_code']) - ->addIndex('ssid', ['name' => 'i3c826a8cd_ssid']) - ->addIndex('status', ['name' => 'i3c826a8cd_status']) - ->addIndex('order_no', ['name' => 'i3c826a8cd_order_no']) - ->addIndex('create_time', ['name' => 'i3c826a8cd_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallOrderSender - * @table plugin_wemall_order_sender - * @return void - */ - private function _create_plugin_wemall_order_sender() { - - // 当前数据表 - $table = 'plugin_wemall_order_sender'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-配送', - ]) - ->addColumn('ssid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商城用户编号']) - ->addColumn('order_no','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城订单单号']) - ->addColumn('address_id','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送地址编号']) - ->addColumn('user_idcode','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '收货人证件号码']) - ->addColumn('user_idimg1','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '收货人证件正面']) - ->addColumn('user_idimg2','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '收货人证件反面']) - ->addColumn('user_name','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '收货人联系名称']) - ->addColumn('user_phone','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '收货人联系手机']) - ->addColumn('region_prov','string',['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的省份']) - ->addColumn('region_city','string',['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的城市']) - ->addColumn('region_area','string',['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的区域']) - ->addColumn('region_addr','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '配送的详细地址']) - ->addColumn('delivery_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送模板编号']) - ->addColumn('delivery_count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计费基数']) - ->addColumn('delivery_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '配送计算金额']) - ->addColumn('delivery_remark','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '配送计算描述']) - ->addColumn('express_time','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递发送时间']) - ->addColumn('express_code','string',['limit' => 80, 'default' => '', 'null' => true, 'comment' => '快递运送单号']) - ->addColumn('express_remark','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '快递发送备注']) - ->addColumn('company_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递公司编码']) - ->addColumn('company_name','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '快递公司名称']) - ->addColumn('extra','text',['default' => NULL, 'null' => true, 'comment' => '原始数据']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '发货状态(1待发货,2已发货,3已收货)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'if6f961fc1_unid']) - ->addIndex('ssid', ['name' => 'if6f961fc1_ssid']) - ->addIndex('status', ['name' => 'if6f961fc1_status']) - ->addIndex('deleted', ['name' => 'if6f961fc1_deleted']) - ->addIndex('order_no', ['name' => 'if6f961fc1_order_no']) - ->addIndex('create_time', ['name' => 'if6f961fc1_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserActionCollect - * @table plugin_wemall_user_action_collect - * @return void - */ - private function _create_plugin_wemall_user_action_collect() { - - // 当前数据表 - $table = 'plugin_wemall_user_action_collect'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-收藏', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) - ->addColumn('gcode','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品编号']) - ->addColumn('times','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '记录次数']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'i79fcacf4f_unid']) - ->addIndex('sort', ['name' => 'i79fcacf4f_sort']) - ->addIndex('gcode', ['name' => 'i79fcacf4f_gcode']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserActionComment - * @table plugin_wemall_user_action_comment - * @return void - */ - private function _create_plugin_wemall_user_action_comment() { - - // 当前数据表 - $table = 'plugin_wemall_user_action_comment'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-评论', - ]) - ->addColumn('ssid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) - ->addColumn('code','string',['limit' => 32, 'default' => NULL, 'null' => true, 'comment' => '评论编号']) - ->addColumn('gcode','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) - ->addColumn('ghash','string',['limit' => 32, 'default' => NULL, 'null' => true, 'comment' => '商品哈希']) - ->addColumn('order_no','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']) - ->addColumn('rate','decimal',['precision' => 20, 'scale' => 2, 'default' => '5.00', 'null' => true, 'comment' => '评论分数']) - ->addColumn('content','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '评论内容']) - ->addColumn('images','text',['default' => NULL, 'null' => true, 'comment' => '评论图片']) - ->addColumn('status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '评论状态(0隐藏,1显示)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'ie6e792cc7_unid']) - ->addIndex('code', ['name' => 'ie6e792cc7_code']) - ->addIndex('ssid', ['name' => 'ie6e792cc7_ssid']) - ->addIndex('ghash', ['name' => 'ie6e792cc7_ghash']) - ->addIndex('gcode', ['name' => 'ie6e792cc7_gcode']) - ->addIndex('status', ['name' => 'ie6e792cc7_status']) - ->addIndex('deleted', ['name' => 'ie6e792cc7_deleted']) - ->addIndex('order_no', ['name' => 'ie6e792cc7_order_no']) - ->addIndex('create_time', ['name' => 'ie6e792cc7_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserActionHistory - * @table plugin_wemall_user_action_history - * @return void - */ - private function _create_plugin_wemall_user_action_history() { - - // 当前数据表 - $table = 'plugin_wemall_user_action_history'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-足迹', - ]) - ->addColumn('ssid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) - ->addColumn('gcode','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品编号']) - ->addColumn('times','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '记录次数']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'i9bce34c4f_unid']) - ->addIndex('sort', ['name' => 'i9bce34c4f_sort']) - ->addIndex('ssid', ['name' => 'i9bce34c4f_ssid']) - ->addIndex('gcode', ['name' => 'i9bce34c4f_gcode']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserActionSearch - * @table plugin_wemall_user_action_search - * @return void - */ - private function _create_plugin_wemall_user_action_search() { - - // 当前数据表 - $table = 'plugin_wemall_user_action_search'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-搜索', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) - ->addColumn('keys','string',['limit' => 99, 'default' => '', 'null' => true, 'comment' => '关键词']) - ->addColumn('times','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '搜索次数']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('keys', ['name' => 'i03c8b2b46_keys']) - ->addIndex('unid', ['name' => 'i03c8b2b46_unid']) - ->addIndex('sort', ['name' => 'i03c8b2b46_sort']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserCheckin - * @table plugin_wemall_user_checkin - * @return void - */ - private function _create_plugin_wemall_user_checkin() { - - // 当前数据表 - $table = 'plugin_wemall_user_checkin'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '业务-活动-签到', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UNID']) - ->addColumn('times','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '连续天数']) - ->addColumn('timed','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '奖励天数']) - ->addColumn('date','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '签到日期']) - ->addColumn('balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '赠送余额']) - ->addColumn('integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '赠送积分']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '生效状态(0未生效,1已生效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'i0faf876c0_unid']) - ->addIndex('date', ['name' => 'i0faf876c0_date']) - ->addIndex('status', ['name' => 'i0faf876c0_status']) - ->addIndex('deleted', ['name' => 'i0faf876c0_deleted']) - ->addIndex('create_time', ['name' => 'i0faf876c0_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserCoupon - * @table plugin_wemall_user_coupon - * @return void - */ - private function _create_plugin_wemall_user_coupon() { - - // 当前数据表 - $table = 'plugin_wemall_user_coupon'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-卡券', - ]) - ->addColumn('type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '卡券类型']) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UNID']) - ->addColumn('coid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '配置编号']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '卡券编号']) - ->addColumn('used','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '使用状态']) - ->addColumn('used_time','datetime',['default' => NULL, 'null' => true, 'comment' => '使用时间']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '生效状态(0未生效,1待使用,2已使用,3已过期)']) - ->addColumn('status_desc','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '状态描述']) - ->addColumn('status_time','datetime',['default' => NULL, 'null' => true, 'comment' => '修改时间']) - ->addColumn('expire','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '有效时间']) - ->addColumn('expire_time','datetime',['default' => NULL, 'null' => true, 'comment' => '有效日期']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addColumn('confirm_time','datetime',['default' => NULL, 'null' => true, 'comment' => '到账时间']) - ->addIndex('code', ['name' => 'ic31512dc2_code']) - ->addIndex('unid', ['name' => 'ic31512dc2_unid']) - ->addIndex('coid', ['name' => 'ic31512dc2_coid']) - ->addIndex('used', ['name' => 'ic31512dc2_used']) - ->addIndex('status', ['name' => 'ic31512dc2_status']) - ->addIndex('expire', ['name' => 'ic31512dc2_expire']) - ->addIndex('deleted', ['name' => 'ic31512dc2_deleted']) - ->addIndex('create_time', ['name' => 'ic31512dc2_create_time']) - ->addIndex('confirm_time', ['name' => 'ic31512dc2_confirm_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserCreate - * @table plugin_wemall_user_create - * @return void - */ - private function _create_plugin_wemall_user_create() { - - // 当前数据表 - $table = 'plugin_wemall_user_create'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-创建', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => false, 'comment' => '关联用户']) - ->addColumn('name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '用户姓名']) - ->addColumn('phone','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '手机号码']) - ->addColumn('headimg','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']) - ->addColumn('password','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '初始密码']) - ->addColumn('rebate_total','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '累计返利']) - ->addColumn('rebate_total_code','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '记录编号']) - ->addColumn('rebate_total_desc','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '记录描述']) - ->addColumn('rebate_usable','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '可提返利']) - ->addColumn('rebate_usable_code','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '记录编号']) - ->addColumn('rebate_usable_desc','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '记录描述']) - ->addColumn('agent_entry','tinyinteger',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '代理权限']) - ->addColumn('agent_phone','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '上级手机']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('name', ['name' => 'i55481d44e_name']) - ->addIndex('unid', ['name' => 'i55481d44e_unid']) - ->addIndex('phone', ['name' => 'i55481d44e_phone']) - ->addIndex('status', ['name' => 'i55481d44e_status']) - ->addIndex('deleted', ['name' => 'i55481d44e_deleted']) - ->addIndex('create_time', ['name' => 'i55481d44e_create_time']) - ->addIndex('agent_entry', ['name' => 'i55481d44e_agent_entry']) - ->addIndex('agent_phone', ['name' => 'i55481d44e_agent_phone']) - ->addIndex('rebate_total', ['name' => 'i55481d44e_rebate_total']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserRebate - * @table plugin_wemall_user_rebate - * @return void - */ - private function _create_plugin_wemall_user_rebate() { - - // 当前数据表 - $table = 'plugin_wemall_user_rebate'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-返利', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UNID']) - ->addColumn('layer','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级层级']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励编号']) - ->addColumn('hash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '维一编号']) - ->addColumn('date','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励日期']) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励类型']) - ->addColumn('name','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '奖励名称']) - ->addColumn('amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励数量']) - ->addColumn('order_no','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']) - ->addColumn('order_unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '订单用户']) - ->addColumn('order_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单金额']) - ->addColumn('remark','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '奖励描述']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '生效状态(0未生效,1已生效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addColumn('confirm_time','datetime',['default' => NULL, 'null' => true, 'comment' => '到账时间']) - ->addIndex('type', ['name' => 'i5f9c1d4b3_type']) - ->addIndex('date', ['name' => 'i5f9c1d4b3_date']) - ->addIndex('code', ['name' => 'i5f9c1d4b3_code']) - ->addIndex('name', ['name' => 'i5f9c1d4b3_name']) - ->addIndex('unid', ['name' => 'i5f9c1d4b3_unid']) - ->addIndex('hash', ['name' => 'i5f9c1d4b3_hash']) - ->addIndex('status', ['name' => 'i5f9c1d4b3_status']) - ->addIndex('deleted', ['name' => 'i5f9c1d4b3_deleted']) - ->addIndex('order_no', ['name' => 'i5f9c1d4b3_order_no']) - ->addIndex('order_unid', ['name' => 'i5f9c1d4b3_order_unid']) - ->addIndex('create_time', ['name' => 'i5f9c1d4b3_create_time']) - ->addIndex('confirm_time', ['name' => 'i5f9c1d4b3_confirm_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserRecharge - * @table plugin_wemall_user_recharge - * @return void - */ - private function _create_plugin_wemall_user_recharge() { - - // 当前数据表 - $table = 'plugin_wemall_user_recharge'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-充值', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '账号编号']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作编号']) - ->addColumn('name','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '操作名称']) - ->addColumn('remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '操作备注']) - ->addColumn('amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作金额']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '系统用户']) - ->addColumn('deleted_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '系统用户']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('deleted_time','datetime',['default' => NULL, 'null' => true, 'comment' => '删除时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'id6918c8c5_unid']) - ->addIndex('code', ['name' => 'id6918c8c5_code']) - ->addIndex('deleted', ['name' => 'id6918c8c5_deleted']) - ->addIndex('create_time', ['name' => 'id6918c8c5_create_time']) - ->addIndex('deleted_time', ['name' => 'id6918c8c5_deleted_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserRelation - * @table plugin_wemall_user_relation - * @return void - */ - private function _create_plugin_wemall_user_relation() { - - // 当前数据表 - $table = 'plugin_wemall_user_relation'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-关系', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '当前用户']) - ->addColumn('puids','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '绑定状态']) - ->addColumn('puid1','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上1级代理']) - ->addColumn('puid2','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上2级代理']) - ->addColumn('puid3','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上3级代理']) - ->addColumn('layer','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属层级']) - ->addColumn('path','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '关系路径']) - ->addColumn('extra','text',['default' => NULL, 'null' => true, 'comment' => '扩展数据']) - ->addColumn('entry_agent','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '推广权益(0无,1有)']) - ->addColumn('entry_member','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '入会礼包(0无,1有)']) - ->addColumn('level_code','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '会员等级']) - ->addColumn('level_name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '会员名称']) - ->addColumn('agent_uuid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '绑定用户']) - ->addColumn('agent_state','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '绑定状态']) - ->addColumn('agent_level_code','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理等级']) - ->addColumn('agent_level_name','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '代理名称']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'i863175e04_unid']) - ->addIndex('path', ['name' => 'i863175e04_path']) - ->addIndex('puid1', ['name' => 'i863175e04_puid1']) - ->addIndex('puid2', ['name' => 'i863175e04_puid2']) - ->addIndex('puid3', ['name' => 'i863175e04_puid3']) - ->addIndex('level_code', ['name' => 'i863175e04_level_code']) - ->addIndex('agent_uuid', ['name' => 'i863175e04_agent_uuid']) - ->addIndex('create_time', ['name' => 'i863175e04_create_time']) - ->addIndex('entry_agent', ['name' => 'i863175e04_entry_agent']) - ->addIndex('entry_member', ['name' => 'i863175e04_entry_member']) - ->addIndex('agent_level_code', ['name' => 'i863175e04_agent_level_code']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWemallUserTransfer - * @table plugin_wemall_user_transfer - * @return void - */ - private function _create_plugin_wemall_user_transfer() { - - // 当前数据表 - $table = 'plugin_wemall_user_transfer'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-提现', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UNID']) - ->addColumn('type','string',['limit' => 30, 'default' => '', 'null' => true, 'comment' => '提现方式']) - ->addColumn('date','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '提现日期']) - ->addColumn('code','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '提现单号']) - ->addColumn('appid','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) - ->addColumn('openid','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号OPENID']) - ->addColumn('username','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号真实姓名']) - ->addColumn('charge_rate','decimal',['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '提现手续费比例']) - ->addColumn('charge_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '提现手续费金额']) - ->addColumn('amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '提现转账金额']) - ->addColumn('qrcode','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '收款码图片地址']) - ->addColumn('bank_wseq','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '微信银行编号']) - ->addColumn('bank_name','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户银行名称']) - ->addColumn('bank_bran','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户分行名称']) - ->addColumn('bank_user','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户账号姓名']) - ->addColumn('bank_code','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户银行卡号']) - ->addColumn('alipay_user','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付宝姓名']) - ->addColumn('alipay_code','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付宝账号']) - ->addColumn('remark','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '提现描述']) - ->addColumn('trade_no','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '交易单号']) - ->addColumn('trade_time','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '打款时间']) - ->addColumn('change_time','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '处理时间']) - ->addColumn('change_desc','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '处理描述']) - ->addColumn('audit_time','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '审核时间']) - ->addColumn('audit_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '审核状态']) - ->addColumn('audit_remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '审核描述']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'i574337aba_code']) - ->addIndex('unid', ['name' => 'i574337aba_unid']) - ->addIndex('date', ['name' => 'i574337aba_date']) - ->addIndex('type', ['name' => 'i574337aba_type']) - ->addIndex('appid', ['name' => 'i574337aba_appid']) - ->addIndex('openid', ['name' => 'i574337aba_openid']) - ->addIndex('status', ['name' => 'i574337aba_status']) - ->addIndex('create_time', ['name' => 'i574337aba_create_time']) - ->addIndex('audit_status', ['name' => 'i574337aba_audit_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - -} diff --git a/database/migrations/20009999999968_install_payment_table.php b/database/migrations/20009999999968_install_payment_table.php deleted file mode 100644 index ffd0126be..000000000 --- a/database/migrations/20009999999968_install_payment_table.php +++ /dev/null @@ -1,315 +0,0 @@ -_create_plugin_payment_address(); - $this->_create_plugin_payment_balance(); - $this->_create_plugin_payment_config(); - $this->_create_plugin_payment_integral(); - $this->_create_plugin_payment_record(); - $this->_create_plugin_payment_refund(); - - } - - /** - * 创建数据对象 - * @class PluginPaymentAddress - * @table plugin_payment_address - * @return void - */ - private function _create_plugin_payment_address() { - - // 当前数据表 - $table = 'plugin_payment_address'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-地址', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '主账号ID']) - ->addColumn('type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '默认状态(0普通,1默认)']) - ->addColumn('idcode','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '身体证证号']) - ->addColumn('idimg1','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '身份证正面']) - ->addColumn('idimg2','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '身份证反面']) - ->addColumn('user_name','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '收货人姓名']) - ->addColumn('user_phone','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '收货人手机']) - ->addColumn('region_prov','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-省份']) - ->addColumn('region_city','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-城市']) - ->addColumn('region_area','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-区域']) - ->addColumn('region_addr','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '地址-详情']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('type', ['name' => 'i368e636cc_type']) - ->addIndex('unid', ['name' => 'i368e636cc_unid']) - ->addIndex('deleted', ['name' => 'i368e636cc_deleted']) - ->addIndex('user_phone', ['name' => 'i368e636cc_user_phone']) - ->addIndex('create_time', ['name' => 'i368e636cc_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginPaymentBalance - * @table plugin_payment_balance - * @return void - */ - private function _create_plugin_payment_balance() { - - // 当前数据表 - $table = 'plugin_payment_balance'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-余额', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '账号编号']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作编号']) - ->addColumn('name','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '操作名称']) - ->addColumn('remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '操作备注']) - ->addColumn('amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作金额']) - ->addColumn('amount_prev','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作前金额']) - ->addColumn('amount_next','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作后金额']) - ->addColumn('cancel','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '作废状态(0未作废,1已作废)']) - ->addColumn('unlock','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '解锁状态(0锁定中,1已生效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '系统用户']) - ->addColumn('cancel_time','datetime',['default' => NULL, 'null' => true, 'comment' => '作废时间']) - ->addColumn('unlock_time','datetime',['default' => NULL, 'null' => true, 'comment' => '解锁时间']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('deleted_time','datetime',['default' => NULL, 'null' => true, 'comment' => '删除时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'i8a8f8318f_unid']) - ->addIndex('code', ['name' => 'i8a8f8318f_code']) - ->addIndex('cancel', ['name' => 'i8a8f8318f_cancel']) - ->addIndex('unlock', ['name' => 'i8a8f8318f_unlock']) - ->addIndex('deleted', ['name' => 'i8a8f8318f_deleted']) - ->addIndex('create_time', ['name' => 'i8a8f8318f_create_time']) - ->addIndex('deleted_time', ['name' => 'i8a8f8318f_deleted_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginPaymentConfig - * @table plugin_payment_config - * @return void - */ - private function _create_plugin_payment_config() { - - // 当前数据表 - $table = 'plugin_payment_config'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-配置', - ]) - ->addColumn('type','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '支付类型']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '通道编号']) - ->addColumn('name','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付名称']) - ->addColumn('cover','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '支付图标']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '支付说明']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '支付参数']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '支付状态(1使用,0禁用)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('type', ['name' => 'if27d5755e_type']) - ->addIndex('code', ['name' => 'if27d5755e_code']) - ->addIndex('sort', ['name' => 'if27d5755e_sort']) - ->addIndex('status', ['name' => 'if27d5755e_status']) - ->addIndex('deleted', ['name' => 'if27d5755e_deleted']) - ->addIndex('create_time', ['name' => 'if27d5755e_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginPaymentIntegral - * @table plugin_payment_integral - * @return void - */ - private function _create_plugin_payment_integral() { - - // 当前数据表 - $table = 'plugin_payment_integral'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-积分', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '账号编号']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作编号']) - ->addColumn('name','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '操作名称']) - ->addColumn('remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '操作备注']) - ->addColumn('amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作金额']) - ->addColumn('amount_prev','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作前金额']) - ->addColumn('amount_next','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作后金额']) - ->addColumn('cancel','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '作废状态(0未作废,1已作废)']) - ->addColumn('unlock','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '解锁状态(0锁定中,1已生效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '系统用户']) - ->addColumn('cancel_time','datetime',['default' => NULL, 'null' => true, 'comment' => '作废时间']) - ->addColumn('unlock_time','datetime',['default' => NULL, 'null' => true, 'comment' => '解锁时间']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('deleted_time','datetime',['default' => NULL, 'null' => true, 'comment' => '删除时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'ie9553d71a_unid']) - ->addIndex('code', ['name' => 'ie9553d71a_code']) - ->addIndex('cancel', ['name' => 'ie9553d71a_cancel']) - ->addIndex('unlock', ['name' => 'ie9553d71a_unlock']) - ->addIndex('deleted', ['name' => 'ie9553d71a_deleted']) - ->addIndex('create_time', ['name' => 'ie9553d71a_create_time']) - ->addIndex('deleted_time', ['name' => 'ie9553d71a_deleted_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginPaymentRecord - * @table plugin_payment_record - * @return void - */ - private function _create_plugin_payment_record() { - - // 当前数据表 - $table = 'plugin_payment_record'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-行为', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '主账号编号']) - ->addColumn('usid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '子账号编号']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '发起支付号']) - ->addColumn('order_no','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '原订单编号']) - ->addColumn('order_name','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '原订单标题']) - ->addColumn('order_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '原订单金额']) - ->addColumn('channel_type','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '支付通道类型']) - ->addColumn('channel_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '支付通道编号']) - ->addColumn('payment_time','datetime',['default' => NULL, 'null' => true, 'comment' => '支付生效时间']) - ->addColumn('payment_trade','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '平台交易编号']) - ->addColumn('payment_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态(0未付,1已付,2取消)']) - ->addColumn('payment_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际支付金额']) - ->addColumn('payment_coupon','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '平台优惠券金额']) - ->addColumn('payment_images','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '凭证支付图片']) - ->addColumn('payment_remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '支付状态备注']) - ->addColumn('payment_notify','text',['default' => NULL, 'null' => true, 'comment' => '支付通知内容']) - ->addColumn('audit_user','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '审核用户(系统用户ID)']) - ->addColumn('audit_time','datetime',['default' => NULL, 'null' => true, 'comment' => '审核时间']) - ->addColumn('audit_status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '审核状态(0已拒,1待审,2已审)']) - ->addColumn('audit_remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '审核描述']) - ->addColumn('refund_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '退款状态(0未退,1已退)']) - ->addColumn('refund_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '累计退款']) - ->addColumn('refund_payment','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回金额']) - ->addColumn('refund_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回余额']) - ->addColumn('refund_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回积分']) - ->addColumn('used_payment','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '支付金额']) - ->addColumn('used_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '扣除余额']) - ->addColumn('used_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '扣除积分']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'id72e373f8_unid']) - ->addIndex('usid', ['name' => 'id72e373f8_usid']) - ->addIndex('code', ['name' => 'id72e373f8_code']) - ->addIndex('order_no', ['name' => 'id72e373f8_order_no']) - ->addIndex('create_time', ['name' => 'id72e373f8_create_time']) - ->addIndex('audit_status', ['name' => 'id72e373f8_audit_status']) - ->addIndex('channel_type', ['name' => 'id72e373f8_channel_type']) - ->addIndex('channel_code', ['name' => 'id72e373f8_channel_code']) - ->addIndex('payment_trade', ['name' => 'id72e373f8_payment_trade']) - ->addIndex('refund_status', ['name' => 'id72e373f8_refund_status']) - ->addIndex('payment_status', ['name' => 'id72e373f8_payment_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginPaymentRefund - * @table plugin_payment_refund - * @return void - */ - private function _create_plugin_payment_refund() { - - // 当前数据表 - $table = 'plugin_payment_refund'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-退款', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '主账号编号']) - ->addColumn('usid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '子账号编号']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '发起支付号']) - ->addColumn('record_code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '子支付编号']) - ->addColumn('refund_time','datetime',['default' => NULL, 'null' => true, 'comment' => '完成时间']) - ->addColumn('refund_trade','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '交易编号']) - ->addColumn('refund_status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态(0未付,1已付,2取消)']) - ->addColumn('refund_amount','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退款金额']) - ->addColumn('refund_account','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '退回账号']) - ->addColumn('refund_scode','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '状态编码']) - ->addColumn('refund_remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '退款备注']) - ->addColumn('refund_notify','text',['default' => NULL, 'null' => true, 'comment' => '通知内容']) - ->addColumn('used_payment','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回金额']) - ->addColumn('used_balance','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回余额']) - ->addColumn('used_integral','decimal',['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回积分']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('unid', ['name' => 'icef9ec8c0_unid']) - ->addIndex('usid', ['name' => 'icef9ec8c0_usid']) - ->addIndex('code', ['name' => 'icef9ec8c0_code']) - ->addIndex('record_code', ['name' => 'icef9ec8c0_record_code']) - ->addIndex('create_time', ['name' => 'icef9ec8c0_create_time']) - ->addIndex('refund_trade', ['name' => 'icef9ec8c0_refund_trade']) - ->addIndex('refund_status', ['name' => 'icef9ec8c0_refund_status']) - ->addIndex('refund_account', ['name' => 'icef9ec8c0_refund_account']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - -} diff --git a/database/migrations/20009999999969_install_old_table.php b/database/migrations/20009999999969_install_old_table.php deleted file mode 100644 index 7b3a2116a..000000000 --- a/database/migrations/20009999999969_install_old_table.php +++ /dev/null @@ -1,96 +0,0 @@ -_create_plugin_old_user(); - $this->_create_plugin_old_user2(); - - } - - /** - * 创建数据对象 - * @class PluginOldUser - * @table plugin_old_user - * @return void - */ - private function _create_plugin_old_user() { - - // 当前数据表 - $table = 'plugin_old_user'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', - ]) - ->addColumn('nickname','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '昵称']) - ->addColumn('phone','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '绑定手机号']) - ->addColumn('concat','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '联系方式']) - ->addColumn('remark','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '备注']) - ->addColumn('remark2','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '备注名']) - ->addColumn('create_time','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '加入时间']) - ->addColumn('role','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '会员身份']) - ->addColumn('订单数','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->addColumn('优惠券总数','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->addColumn('卡券总数','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->addColumn('integral','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '积分']) - ->addColumn('balance','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '余额']) - ->addColumn('总消费','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->addColumn('spread','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '用户推荐人']) - ->addColumn('用户标签','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->addColumn('所属平台(平台标识ID)','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginOldUser2 - * @table plugin_old_user2 - * @return void - */ - private function _create_plugin_old_user2() { - - // 当前数据表 - $table = 'plugin_old_user2'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', - ]) - ->addColumn('所属平台','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->addColumn('openid','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->addColumn('nickname','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '昵称']) - ->addColumn('username','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '姓名']) - ->addColumn('phone','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '手机号']) - ->addColumn('create_time','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '申请时间']) - ->addColumn('审核状态','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->addColumn('rebate','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '累计佣金']) - ->addColumn('usable','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '可提现佣金']) - ->addColumn('订单数','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->addColumn('下级用户','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->addColumn('spread','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '推荐人']) - ->addColumn('备注信息','string',['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - -} diff --git a/database/migrations/20009999999970_install_account_table.php b/database/migrations/20009999999970_install_account_table.php deleted file mode 100644 index 196b445e8..000000000 --- a/database/migrations/20009999999970_install_account_table.php +++ /dev/null @@ -1,204 +0,0 @@ -_create_plugin_account_auth(); - $this->_create_plugin_account_bind(); - $this->_create_plugin_account_msms(); - $this->_create_plugin_account_user(); - - } - - /** - * 创建数据对象 - * @class PluginAccountAuth - * @table plugin_account_auth - * @return void - */ - private function _create_plugin_account_auth() { - - // 当前数据表 - $table = 'plugin_account_auth'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-账号-授权', - ]) - ->addColumn('usid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '终端账号']) - ->addColumn('time','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '有效时间']) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '授权类型']) - ->addColumn('token','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '授权令牌']) - ->addColumn('tokenv','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '授权验证']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('usid', ['name' => 'i8a91c286f_usid']) - ->addIndex('type', ['name' => 'i8a91c286f_type']) - ->addIndex('time', ['name' => 'i8a91c286f_time']) - ->addIndex('token', ['name' => 'i8a91c286f_token']) - ->addIndex('create_time', ['name' => 'i8a91c286f_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginAccountBind - * @table plugin_account_bind - * @return void - */ - private function _create_plugin_account_bind() { - - // 当前数据表 - $table = 'plugin_account_bind'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-账号-终端', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '会员编号']) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '终端类型']) - ->addColumn('phone','string',['limit' => 30, 'default' => '', 'null' => true, 'comment' => '绑定手机']) - ->addColumn('appid','string',['limit' => 30, 'default' => '', 'null' => true, 'comment' => 'APPID']) - ->addColumn('openid','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => 'OPENID']) - ->addColumn('unionid','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => 'UnionID']) - ->addColumn('headimg','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']) - ->addColumn('nickname','string',['limit' => 99, 'default' => '', 'null' => true, 'comment' => '用户昵称']) - ->addColumn('password','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '登录密码']) - ->addColumn('extra','text',['default' => NULL, 'null' => true, 'comment' => '扩展数据']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '账号状态']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '注册时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('type', ['name' => 'i4ec9ee5c7_type']) - ->addIndex('unid', ['name' => 'i4ec9ee5c7_unid']) - ->addIndex('sort', ['name' => 'i4ec9ee5c7_sort']) - ->addIndex('phone', ['name' => 'i4ec9ee5c7_phone']) - ->addIndex('appid', ['name' => 'i4ec9ee5c7_appid']) - ->addIndex('status', ['name' => 'i4ec9ee5c7_status']) - ->addIndex('openid', ['name' => 'i4ec9ee5c7_openid']) - ->addIndex('unionid', ['name' => 'i4ec9ee5c7_unionid']) - ->addIndex('deleted', ['name' => 'i4ec9ee5c7_deleted']) - ->addIndex('create_time', ['name' => 'i4ec9ee5c7_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginAccountMsms - * @table plugin_account_msms - * @return void - */ - private function _create_plugin_account_msms() { - - // 当前数据表 - $table = 'plugin_account_msms'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-账号-短信', - ]) - ->addColumn('unid','biginteger',['limit' => 20, 'default' => 0, 'null' => false, 'comment' => '账号编号']) - ->addColumn('usid','biginteger',['limit' => 20, 'default' => 0, 'null' => false, 'comment' => '终端编号']) - ->addColumn('type','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '短信类型']) - ->addColumn('scene','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '业务场景']) - ->addColumn('smsid','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '消息编号']) - ->addColumn('phone','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '目标手机']) - ->addColumn('result','string',['limit' => 512, 'default' => '', 'null' => true, 'comment' => '返回结果']) - ->addColumn('params','string',['limit' => 512, 'default' => '', 'null' => true, 'comment' => '短信内容']) - ->addColumn('status','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '短信状态(0失败,1成功)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('type', ['name' => 'i66baec398_type']) - ->addIndex('usid', ['name' => 'i66baec398_usid']) - ->addIndex('unid', ['name' => 'i66baec398_unid']) - ->addIndex('phone', ['name' => 'i66baec398_phone']) - ->addIndex('smsid', ['name' => 'i66baec398_smsid']) - ->addIndex('scene', ['name' => 'i66baec398_scene']) - ->addIndex('status', ['name' => 'i66baec398_status']) - ->addIndex('create_time', ['name' => 'i66baec398_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginAccountUser - * @table plugin_account_user - * @return void - */ - private function _create_plugin_account_user() { - - // 当前数据表 - $table = 'plugin_account_user'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-账号-资料', - ]) - ->addColumn('code','string',['limit' => 16, 'default' => '', 'null' => true, 'comment' => '用户编号']) - ->addColumn('phone','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户手机']) - ->addColumn('email','string',['limit' => 99, 'default' => '', 'null' => true, 'comment' => '用户邮箱']) - ->addColumn('unionid','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => 'UnionID']) - ->addColumn('username','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户姓名']) - ->addColumn('nickname','string',['limit' => 99, 'default' => '', 'null' => true, 'comment' => '用户昵称']) - ->addColumn('password','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '认证密码']) - ->addColumn('headimg','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']) - ->addColumn('region_prov','string',['limit' => 99, 'default' => '', 'null' => true, 'comment' => '所在省份']) - ->addColumn('region_city','string',['limit' => 99, 'default' => '', 'null' => true, 'comment' => '所在城市']) - ->addColumn('region_area','string',['limit' => 99, 'default' => '', 'null' => true, 'comment' => '所在区域']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '备注(内部使用)']) - ->addColumn('extra','text',['default' => NULL, 'null' => true, 'comment' => '扩展数据']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '用户状态(0拉黑,1正常)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '注册时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'iddb76b051_code']) - ->addIndex('sort', ['name' => 'iddb76b051_sort']) - ->addIndex('phone', ['name' => 'iddb76b051_phone']) - ->addIndex('email', ['name' => 'iddb76b051_email']) - ->addIndex('status', ['name' => 'iddb76b051_status']) - ->addIndex('unionid', ['name' => 'iddb76b051_unionid']) - ->addIndex('deleted', ['name' => 'iddb76b051_deleted']) - ->addIndex('username', ['name' => 'iddb76b051_username']) - ->addIndex('nickname', ['name' => 'iddb76b051_nickname']) - ->addIndex('region_prov', ['name' => 'iddb76b051_region_prov']) - ->addIndex('region_city', ['name' => 'iddb76b051_region_city']) - ->addIndex('region_area', ['name' => 'iddb76b051_region_area']) - ->addIndex('create_time', ['name' => 'iddb76b051_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - -} diff --git a/database/migrations/20009999999974_install_wuma_table.php b/database/migrations/20009999999974_install_wuma_table.php deleted file mode 100644 index 68e98fc1d..000000000 --- a/database/migrations/20009999999974_install_wuma_table.php +++ /dev/null @@ -1,1155 +0,0 @@ -_create_plugin_wuma_code_rule(); - $this->_create_plugin_wuma_code_rule_range(); - $this->_create_plugin_wuma_sales_order(); - $this->_create_plugin_wuma_sales_order_data(); - $this->_create_plugin_wuma_sales_order_data_mins(); - $this->_create_plugin_wuma_sales_order_data_nums(); - $this->_create_plugin_wuma_sales_user(); - $this->_create_plugin_wuma_sales_user_level(); - $this->_create_plugin_wuma_sales_user_stock(); - $this->_create_plugin_wuma_source_assign(); - $this->_create_plugin_wuma_source_assign_item(); - $this->_create_plugin_wuma_source_blockchain(); - $this->_create_plugin_wuma_source_certificate(); - $this->_create_plugin_wuma_source_produce(); - $this->_create_plugin_wuma_source_query(); - $this->_create_plugin_wuma_source_query_notify(); - $this->_create_plugin_wuma_source_query_verify(); - $this->_create_plugin_wuma_source_template(); - $this->_create_plugin_wuma_warehouse(); - $this->_create_plugin_wuma_warehouse_order(); - $this->_create_plugin_wuma_warehouse_order_data(); - $this->_create_plugin_wuma_warehouse_order_data_mins(); - $this->_create_plugin_wuma_warehouse_order_data_nums(); - $this->_create_plugin_wuma_warehouse_relation(); - $this->_create_plugin_wuma_warehouse_relation_data(); - $this->_create_plugin_wuma_warehouse_replace(); - $this->_create_plugin_wuma_warehouse_stock(); - $this->_create_plugin_wuma_warehouse_user(); - - } - - /** - * 创建数据对象 - * @class PluginWumaCodeRule - * @table plugin_wuma_code_rule - * @return void - */ - private function _create_plugin_wuma_code_rule() { - - // 当前数据表 - $table = 'plugin_wuma_code_rule'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-生码-规则', - ]) - ->addColumn('type','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '批次类型(1前关联,2后关联)']) - ->addColumn('batch','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '批次编号']) - ->addColumn('mid_min','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '中码与小码比值']) - ->addColumn('max_mid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '大码与中码比值']) - ->addColumn('sns_start','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '序号起始值']) - ->addColumn('sns_after','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '序号结束值']) - ->addColumn('sns_length','biginteger',['limit' => 20, 'default' => 20, 'null' => true, 'comment' => '序号长度']) - ->addColumn('max_length','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '大码长度']) - ->addColumn('mid_length','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '中码长度']) - ->addColumn('min_length','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '小码长度']) - ->addColumn('hex_length','biginteger',['limit' => 20, 'default' => 10, 'null' => true, 'comment' => '加密长度']) - ->addColumn('ver_length','biginteger',['limit' => 20, 'default' => 4, 'null' => true, 'comment' => '验证长度']) - ->addColumn('max_number','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '大码数量']) - ->addColumn('mid_number','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '中码数量']) - ->addColumn('number','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码总数']) - ->addColumn('template','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '导出模板']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '物码描述']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('type', ['name' => 'ia578a2d18_type']) - ->addIndex('batch', ['name' => 'ia578a2d18_batch']) - ->addIndex('status', ['name' => 'ia578a2d18_status']) - ->addIndex('deleted', ['name' => 'ia578a2d18_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaCodeRuleRange - * @table plugin_wuma_code_rule_range - * @return void - */ - private function _create_plugin_wuma_code_rule_range() { - - // 当前数据表 - $table = 'plugin_wuma_code_rule_range'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-生码-范围', - ]) - ->addColumn('type','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '物码类型']) - ->addColumn('batch','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码批次号']) - ->addColumn('code_type','string',['limit' => 3, 'default' => '', 'null' => true, 'comment' => '数码类型(min小码,mid中码,max大码)']) - ->addColumn('code_length','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数码长度']) - ->addColumn('range_start','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '起始数码']) - ->addColumn('range_after','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '结束数码']) - ->addColumn('range_number','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数码数量']) - ->addIndex('type', ['name' => 'i39dabc79d_type']) - ->addIndex('code_type', ['name' => 'i39dabc79d_code_type']) - ->addIndex('code_length', ['name' => 'i39dabc79d_code_length']) - ->addIndex('range_start', ['name' => 'i39dabc79d_range_start']) - ->addIndex('range_after', ['name' => 'i39dabc79d_range_after']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSalesOrder - * @table plugin_wuma_sales_order - * @return void - */ - private function _create_plugin_wuma_sales_order() { - - // 当前数据表 - $table = 'plugin_wuma_sales_order'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-订单', - ]) - ->addColumn('auid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '经销商编号']) - ->addColumn('xuid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '来源经销商']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作单单号']) - ->addColumn('mode','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作方式(1扫码,2虚拟)']) - ->addColumn('ghash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈唏']) - ->addColumn('vir_need','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟库统计']) - ->addColumn('vir_count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟库使用']) - ->addColumn('num_need','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '累计出库数量']) - ->addColumn('num_count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '累计已经出库']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效,2完成)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('auid', ['name' => 'i1f94143fc_auid']) - ->addIndex('xuid', ['name' => 'i1f94143fc_xuid']) - ->addIndex('code', ['name' => 'i1f94143fc_code']) - ->addIndex('mode', ['name' => 'i1f94143fc_mode']) - ->addIndex('ghash', ['name' => 'i1f94143fc_ghash']) - ->addIndex('status', ['name' => 'i1f94143fc_status']) - ->addIndex('deleted', ['name' => 'i1f94143fc_deleted']) - ->addIndex('create_time', ['name' => 'i1f94143fc_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSalesOrderData - * @table plugin_wuma_sales_order_data - * @return void - */ - private function _create_plugin_wuma_sales_order_data() { - - // 当前数据表 - $table = 'plugin_wuma_sales_order_data'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-数据', - ]) - ->addColumn('auid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '经销商编号']) - ->addColumn('xuid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '来源经销商']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作单号']) - ->addColumn('mode','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作方式(1扫码,2虚拟)']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']) - ->addColumn('number','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码总数']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('auid', ['name' => 'ibf51d799e_auid']) - ->addIndex('xuid', ['name' => 'ibf51d799e_xuid']) - ->addIndex('mode', ['name' => 'ibf51d799e_mode']) - ->addIndex('code', ['name' => 'ibf51d799e_code']) - ->addIndex('status', ['name' => 'ibf51d799e_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSalesOrderDataMins - * @table plugin_wuma_sales_order_data_mins - * @return void - */ - private function _create_plugin_wuma_sales_order_data_mins() { - - // 当前数据表 - $table = 'plugin_wuma_sales_order_data_mins'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-小码', - ]) - ->addColumn('ddid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数据编号']) - ->addColumn('auid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理编号']) - ->addColumn('code','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码数据']) - ->addColumn('mode','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作类型(1扫码,2虚拟)']) - ->addColumn('stock','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '库存有效']) - ->addColumn('ghash','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品哈唏']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '数据状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0有效,1已删)']) - ->addColumn('status_time','datetime',['default' => NULL, 'null' => true, 'comment' => '状态时间']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addIndex('ddid', ['name' => 'i4b3ba8dcc_ddid']) - ->addIndex('auid', ['name' => 'i4b3ba8dcc_auid']) - ->addIndex('code', ['name' => 'i4b3ba8dcc_code']) - ->addIndex('mode', ['name' => 'i4b3ba8dcc_mode']) - ->addIndex('stock', ['name' => 'i4b3ba8dcc_stock']) - ->addIndex('ghash', ['name' => 'i4b3ba8dcc_ghash']) - ->addIndex('status', ['name' => 'i4b3ba8dcc_status']) - ->addIndex('deleted', ['name' => 'i4b3ba8dcc_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSalesOrderDataNums - * @table plugin_wuma_sales_order_data_nums - * @return void - */ - private function _create_plugin_wuma_sales_order_data_nums() { - - // 当前数据表 - $table = 'plugin_wuma_sales_order_data_nums'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-箱码', - ]) - ->addColumn('uuid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属品牌']) - ->addColumn('ddid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数据编号']) - ->addColumn('count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码数量']) - ->addColumn('type','string',['limit' => 40, 'default' => '', 'null' => true, 'comment' => '物码类型']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码数据']) - ->addIndex('type', ['name' => 'i889b5a793_type']) - ->addIndex('uuid', ['name' => 'i889b5a793_uuid']) - ->addIndex('ddid', ['name' => 'i889b5a793_ddid']) - ->addIndex('code', ['name' => 'i889b5a793_code']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSalesUser - * @table plugin_wuma_sales_user - * @return void - */ - private function _create_plugin_wuma_sales_user() { - - // 当前数据表 - $table = 'plugin_wuma_sales_user'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-用户', - ]) - ->addColumn('auid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级代理']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '授权编号']) - ->addColumn('level','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理等级']) - ->addColumn('master','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '总部账号']) - ->addColumn('phone','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户手机']) - ->addColumn('userid','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '身份证号']) - ->addColumn('mobile','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '联系电话']) - ->addColumn('headimg','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']) - ->addColumn('username','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户姓名']) - ->addColumn('password','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '登录密码']) - ->addColumn('date_start','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '开始时间']) - ->addColumn('date_after','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '结束时间']) - ->addColumn('super_auid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '邀请上级用户']) - ->addColumn('super_phone','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '邀请上级手机']) - ->addColumn('business','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '营业执照']) - ->addColumn('region_prov','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属省份']) - ->addColumn('region_city','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属城市']) - ->addColumn('region_area','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属区域']) - ->addColumn('region_address','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '详细地址']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户备注描述']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '用户状态(1正常,0已黑)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '注册时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('auid', ['name' => 'i377b9bafa_auid']) - ->addIndex('code', ['name' => 'i377b9bafa_code']) - ->addIndex('level', ['name' => 'i377b9bafa_level']) - ->addIndex('status', ['name' => 'i377b9bafa_status']) - ->addIndex('deleted', ['name' => 'i377b9bafa_deleted']) - ->addIndex('super_auid', ['name' => 'i377b9bafa_super_auid']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSalesUserLevel - * @table plugin_wuma_sales_user_level - * @return void - */ - private function _create_plugin_wuma_sales_user_level() { - - // 当前数据表 - $table = 'plugin_wuma_sales_user_level'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-等级', - ]) - ->addColumn('name','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '代理级别名称']) - ->addColumn('number','integer',['limit' => 2, 'default' => 0, 'null' => true, 'comment' => '代理级别序号']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '代理级别描述']) - ->addColumn('utime','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '等级更新时间']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '代理等级状态(1使用,0禁用)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '等级创建时间']) - ->addIndex('status', ['name' => 'i229ec78e0_status']) - ->addIndex('number', ['name' => 'i229ec78e0_number']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSalesUserStock - * @table plugin_wuma_sales_user_stock - * @return void - */ - private function _create_plugin_wuma_sales_user_stock() { - - // 当前数据表 - $table = 'plugin_wuma_sales_user_stock'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-库存', - ]) - ->addColumn('auid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '经销编号']) - ->addColumn('ghash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈唏']) - ->addColumn('vir_total','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟库存']) - ->addColumn('vir_count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟出货']) - ->addColumn('num_total','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '累计库存']) - ->addColumn('num_count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '累计出货']) - ->addIndex('auid', ['name' => 'i04cc86743_auid']) - ->addIndex('ghash', ['name' => 'i04cc86743_ghash']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSourceAssign - * @table plugin_wuma_source_assign - * @return void - */ - private function _create_plugin_wuma_source_assign() { - - // 当前数据表 - $table = 'plugin_wuma_source_assign'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-赋码批次', - ]) - ->addColumn('type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '赋码类型(0区间,1关联)']) - ->addColumn('batch','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '赋码批次号']) - ->addColumn('cbatch','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码批次号']) - ->addColumn('outer_items','text',['default' => NULL, 'null' => true, 'comment' => 'JSON出库']) - ->addColumn('coder_items2','text',['default' => NULL, 'null' => true, 'comment' => 'JSON赋码']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('type', ['name' => 'ia625c5e0a_type']) - ->addIndex('batch', ['name' => 'ia625c5e0a_batch']) - ->addIndex('cbatch', ['name' => 'ia625c5e0a_cbatch']) - ->addIndex('status', ['name' => 'ia625c5e0a_status']) - ->addIndex('deleted', ['name' => 'ia625c5e0a_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSourceAssignItem - * @table plugin_wuma_source_assign_item - * @return void - */ - private function _create_plugin_wuma_source_assign_item() { - - // 当前数据表 - $table = 'plugin_wuma_source_assign_item'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-赋码规则', - ]) - ->addColumn('real','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否真锁定']) - ->addColumn('lock','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否已锁定']) - ->addColumn('batch','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '赋码批次号']) - ->addColumn('cbatch','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码批次号']) - ->addColumn('pbatch','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '生产批次号']) - ->addColumn('range_start','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '开始物码区间']) - ->addColumn('range_after','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '结束物码区间']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('lock', ['name' => 'i055bd72d1_lock']) - ->addIndex('real', ['name' => 'i055bd72d1_real']) - ->addIndex('batch', ['name' => 'i055bd72d1_batch']) - ->addIndex('cbatch', ['name' => 'i055bd72d1_cbatch']) - ->addIndex('pbatch', ['name' => 'i055bd72d1_pbatch']) - ->addIndex('range_start', ['name' => 'i055bd72d1_range_start']) - ->addIndex('range_after', ['name' => 'i055bd72d1_range_after']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSourceBlockchain - * @table plugin_wuma_source_blockchain - * @return void - */ - private function _create_plugin_wuma_source_blockchain() { - - // 当前数据表 - $table = 'plugin_wuma_source_blockchain'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-区块链', - ]) - ->addColumn('scid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '确权证书']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '流程编号']) - ->addColumn('hash','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '流程HASH']) - ->addColumn('name','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '流程名称']) - ->addColumn('data','text',['default' => NULL, 'null' => true, 'comment' => '流程环节']) - ->addColumn('remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '流程备注']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删1已删)']) - ->addColumn('hash_time','datetime',['default' => NULL, 'null' => true, 'comment' => '上链时间']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'i035596f4d_code']) - ->addIndex('scid', ['name' => 'i035596f4d_scid']) - ->addIndex('sort', ['name' => 'i035596f4d_sort']) - ->addIndex('status', ['name' => 'i035596f4d_status']) - ->addIndex('deleted', ['name' => 'i035596f4d_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSourceCertificate - * @table plugin_wuma_source_certificate - * @return void - */ - private function _create_plugin_wuma_source_certificate() { - - // 当前数据表 - $table = 'plugin_wuma_source_certificate'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-确权证书', - ]) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '模板编号']) - ->addColumn('name','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '模板名称']) - ->addColumn('times','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '访问次数']) - ->addColumn('image','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '证书底图']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '定制规则']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'i550f3ad85_code']) - ->addIndex('status', ['name' => 'i550f3ad85_status']) - ->addIndex('deleted', ['name' => 'i550f3ad85_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSourceProduce - * @table plugin_wuma_source_produce - * @return void - */ - private function _create_plugin_wuma_source_produce() { - - // 当前数据表 - $table = 'plugin_wuma_source_produce'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-生产批次', - ]) - ->addColumn('batch','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '生产批次']) - ->addColumn('ghash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '产品编号']) - ->addColumn('tcode','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '关联溯源模板']) - ->addColumn('addr_prov','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '所在省份']) - ->addColumn('addr_city','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '所在城市']) - ->addColumn('addr_area','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '所在区域']) - ->addColumn('remark','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '批次备注']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效1有效)']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('batch', ['name' => 'i95bd96a03_batch']) - ->addIndex('status', ['name' => 'i95bd96a03_status']) - ->addIndex('deleted', ['name' => 'i95bd96a03_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSourceQuery - * @table plugin_wuma_source_query - * @return void - */ - private function _create_plugin_wuma_source_query() { - - // 当前数据表 - $table = 'plugin_wuma_source_query'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-查询记录', - ]) - ->addColumn('auid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理用户']) - ->addColumn('code','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '小码数码']) - ->addColumn('ghash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈希']) - ->addColumn('times','biginteger',['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '查询次数']) - ->addColumn('encode','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '物码编号']) - ->addColumn('prov','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所在省份']) - ->addColumn('city','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所在城市']) - ->addColumn('area','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所在区域']) - ->addColumn('addr','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '详细地址']) - ->addColumn('geoip','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '访问IP']) - ->addColumn('gtype','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '定位类型']) - ->addColumn('latlng','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '经纬度']) - ->addColumn('notify','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '窜货状态']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'ibdbf0aa26_code']) - ->addIndex('auid', ['name' => 'ibdbf0aa26_auid']) - ->addIndex('prov', ['name' => 'ibdbf0aa26_prov']) - ->addIndex('city', ['name' => 'ibdbf0aa26_city']) - ->addIndex('area', ['name' => 'ibdbf0aa26_area']) - ->addIndex('notify', ['name' => 'ibdbf0aa26_notify']) - ->addIndex('encode', ['name' => 'ibdbf0aa26_encode']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSourceQueryNotify - * @table plugin_wuma_source_query_notify - * @return void - */ - private function _create_plugin_wuma_source_query_notify() { - - // 当前数据表 - $table = 'plugin_wuma_source_query_notify'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-窜货异常', - ]) - ->addColumn('auid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理用户']) - ->addColumn('code','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '小码数码']) - ->addColumn('type','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '记录类型']) - ->addColumn('times','biginteger',['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '查询次数']) - ->addColumn('encode','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '物码编号']) - ->addColumn('prov','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所在省份']) - ->addColumn('city','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所在城市']) - ->addColumn('area','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所在区域']) - ->addColumn('addr','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '详细地址']) - ->addColumn('gtype','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '定位类型']) - ->addColumn('geoip','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '访问IP']) - ->addColumn('latlng','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '经纬度']) - ->addColumn('pcode','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) - ->addColumn('pspec','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '商品规格']) - ->addColumn('agent_prov','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '代理省份']) - ->addColumn('agent_city','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '代理城市']) - ->addColumn('agent_area','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '代理区域']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('auid', ['name' => 'ibc28d4409_auid']) - ->addIndex('prov', ['name' => 'ibc28d4409_prov']) - ->addIndex('city', ['name' => 'ibc28d4409_city']) - ->addIndex('area', ['name' => 'ibc28d4409_area']) - ->addIndex('code', ['name' => 'ibc28d4409_code']) - ->addIndex('encode', ['name' => 'ibc28d4409_encode']) - ->addIndex('agent_prov', ['name' => 'ibc28d4409_agent_prov']) - ->addIndex('agent_city', ['name' => 'ibc28d4409_agent_city']) - ->addIndex('agent_area', ['name' => 'ibc28d4409_agent_area']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSourceQueryVerify - * @table plugin_wuma_source_query_verify - * @return void - */ - private function _create_plugin_wuma_source_query_verify() { - - // 当前数据表 - $table = 'plugin_wuma_source_query_verify'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-查询记录', - ]) - ->addColumn('auid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理用户']) - ->addColumn('code','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '小码数码']) - ->addColumn('times','biginteger',['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '查询次数']) - ->addColumn('ghash','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) - ->addColumn('encode','string',['limit' => 50, 'default' => '', 'null' => true, 'comment' => '物码编号']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'i7875f3381_code']) - ->addIndex('auid', ['name' => 'i7875f3381_auid']) - ->addIndex('encode', ['name' => 'i7875f3381_encode']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaSourceTemplate - * @table plugin_wuma_source_template - * @return void - */ - private function _create_plugin_wuma_source_template() { - - // 当前数据表 - $table = 'plugin_wuma_source_template'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-页面模板', - ]) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '模板编号']) - ->addColumn('name','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '模板名称']) - ->addColumn('times','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '访问次数']) - ->addColumn('styles','text',['default' => NULL, 'null' => true, 'comment' => '主题样式']) - ->addColumn('content','text',['default' => NULL, 'null' => true, 'comment' => '模板内容']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'i79c0c749e_code']) - ->addIndex('status', ['name' => 'i79c0c749e_status']) - ->addIndex('deleted', ['name' => 'i79c0c749e_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaWarehouse - * @table plugin_wuma_warehouse - * @return void - */ - private function _create_plugin_wuma_warehouse() { - - // 当前数据表 - $table = 'plugin_wuma_warehouse'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库', - ]) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '仓库编号']) - ->addColumn('name','string',['limit' => 200, 'default' => '', 'null' => true, 'comment' => '仓库名称']) - ->addColumn('person','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '负责人']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '物码描述']) - ->addColumn('addr_prov','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属省份']) - ->addColumn('addr_city','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属城市']) - ->addColumn('addr_area','string',['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属区域']) - ->addColumn('addr_text','string',['limit' => 255, 'default' => '', 'null' => true, 'comment' => '详细地址']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('code', ['name' => 'ie4be941b1_code']) - ->addIndex('name', ['name' => 'ie4be941b1_name']) - ->addIndex('sort', ['name' => 'ie4be941b1_sort']) - ->addIndex('status', ['name' => 'ie4be941b1_status']) - ->addIndex('deleted', ['name' => 'ie4be941b1_deleted']) - ->addIndex('create_time', ['name' => 'ie4be941b1_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaWarehouseOrder - * @table plugin_wuma_warehouse_order - * @return void - */ - private function _create_plugin_wuma_warehouse_order() { - - // 当前数据表 - $table = 'plugin_wuma_warehouse_order'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-订单', - ]) - ->addColumn('type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '操作类型(1订单入库,2直接入库,3调货入库,4订单出库,5直接出库,6调货出库,7关联出库,8直接退货)']) - ->addColumn('mode','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作方式(1扫码操作,2虚拟操作)']) - ->addColumn('auid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '出库代理']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作单号']) - ->addColumn('wcode','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '仓库编号']) - ->addColumn('ghash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '绑定产品']) - ->addColumn('vir_need','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟总数']) - ->addColumn('vir_used','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟完成']) - ->addColumn('num_need','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '扫码总数']) - ->addColumn('num_used','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '扫码完成']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效,2完成)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addColumn('deleted_time','datetime',['default' => NULL, 'null' => true, 'comment' => '删除时间']) - ->addIndex('mode', ['name' => 'ic05f6dea4_mode']) - ->addIndex('auid', ['name' => 'ic05f6dea4_auid']) - ->addIndex('type', ['name' => 'ic05f6dea4_type']) - ->addIndex('code', ['name' => 'ic05f6dea4_code']) - ->addIndex('ghash', ['name' => 'ic05f6dea4_ghash']) - ->addIndex('wcode', ['name' => 'ic05f6dea4_wcode']) - ->addIndex('status', ['name' => 'ic05f6dea4_status']) - ->addIndex('deleted', ['name' => 'ic05f6dea4_deleted']) - ->addIndex('create_time', ['name' => 'ic05f6dea4_create_time']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaWarehouseOrderData - * @table plugin_wuma_warehouse_order_data - * @return void - */ - private function _create_plugin_wuma_warehouse_order_data() { - - // 当前数据表 - $table = 'plugin_wuma_warehouse_order_data'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-数据', - ]) - ->addColumn('type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '操作类型(1订单入库,2直接入库,3调货入库,4订单出库,5直接出库,6调货出库,7关联出库,8直接退货)']) - ->addColumn('mode','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作方式(1扫码操作,2虚拟操作)']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作单号']) - ->addColumn('number','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '标签总数']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addIndex('mode', ['name' => 'i4970a1f8f_mode']) - ->addIndex('type', ['name' => 'i4970a1f8f_type']) - ->addIndex('code', ['name' => 'i4970a1f8f_code']) - ->addIndex('status', ['name' => 'i4970a1f8f_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaWarehouseOrderDataMins - * @table plugin_wuma_warehouse_order_data_mins - * @return void - */ - private function _create_plugin_wuma_warehouse_order_data_mins() { - - // 当前数据表 - $table = 'plugin_wuma_warehouse_order_data_mins'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-小码', - ]) - ->addColumn('type','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '操作类型(1订单入库,2直接入库,3调货入库,4订单出库,5直接出库,6调货出库,7关联出库,8直接退货)']) - ->addColumn('mode','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作方式(1扫码操作,2虚拟操作)']) - ->addColumn('ddid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数据编号']) - ->addColumn('code','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码数据']) - ->addColumn('stock','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '调货:库存有效(0已出,1暂存)']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '退货:记录状态(0无效,1有效)']) - ->addColumn('status_time','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '状态时间']) - ->addIndex('type', ['name' => 'ieae539ea0_type']) - ->addIndex('mode', ['name' => 'ieae539ea0_mode']) - ->addIndex('ddid', ['name' => 'ieae539ea0_ddid']) - ->addIndex('code', ['name' => 'ieae539ea0_code']) - ->addIndex('stock', ['name' => 'ieae539ea0_stock']) - ->addIndex('status', ['name' => 'ieae539ea0_status']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaWarehouseOrderDataNums - * @table plugin_wuma_warehouse_order_data_nums - * @return void - */ - private function _create_plugin_wuma_warehouse_order_data_nums() { - - // 当前数据表 - $table = 'plugin_wuma_warehouse_order_data_nums'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-箱码', - ]) - ->addColumn('ddid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数据编号']) - ->addColumn('type','string',['limit' => 40, 'default' => '', 'null' => true, 'comment' => '物码类型']) - ->addColumn('code','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码数据']) - ->addColumn('count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码数量']) - ->addIndex('ddid', ['name' => 'ie9a274f6f_ddid']) - ->addIndex('code', ['name' => 'ie9a274f6f_code']) - ->addIndex('type', ['name' => 'ie9a274f6f_type']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaWarehouseRelation - * @table plugin_wuma_warehouse_relation - * @return void - */ - private function _create_plugin_wuma_warehouse_relation() { - - // 当前数据表 - $table = 'plugin_wuma_warehouse_relation'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-关联', - ]) - ->addColumn('max','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '大码数值']) - ->addColumn('mid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '中码数值']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上传用户']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addIndex('max', ['name' => 'i10d5c759c_max']) - ->addIndex('mid', ['name' => 'i10d5c759c_mid']) - ->addIndex('deleted', ['name' => 'i10d5c759c_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaWarehouseRelationData - * @table plugin_wuma_warehouse_relation_data - * @return void - */ - private function _create_plugin_wuma_warehouse_relation_data() { - - // 当前数据表 - $table = 'plugin_wuma_warehouse_relation_data'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-关联', - ]) - ->addColumn('rid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '批次数据']) - ->addColumn('max','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '大码数值']) - ->addColumn('mid','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '中码数值']) - ->addColumn('min','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '小码数值']) - ->addColumn('number','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '防窜编码']) - ->addColumn('encode','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '防伪编码']) - ->addColumn('lock','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '锁定状态']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上传用户']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addIndex('rid', ['name' => 'i1ef793abd_rid']) - ->addIndex('max', ['name' => 'i1ef793abd_max']) - ->addIndex('mid', ['name' => 'i1ef793abd_mid']) - ->addIndex('min', ['name' => 'i1ef793abd_min']) - ->addIndex('lock', ['name' => 'i1ef793abd_lock']) - ->addIndex('status', ['name' => 'i1ef793abd_status']) - ->addIndex('encode', ['name' => 'i1ef793abd_encode']) - ->addIndex('number', ['name' => 'i1ef793abd_number']) - ->addIndex('deleted', ['name' => 'i1ef793abd_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaWarehouseReplace - * @table plugin_wuma_warehouse_replace - * @return void - */ - private function _create_plugin_wuma_warehouse_replace() { - - // 当前数据表 - $table = 'plugin_wuma_warehouse_replace'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-替换', - ]) - ->addColumn('type','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码类型']) - ->addColumn('smin','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '原值小码']) - ->addColumn('tmin','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '目标小码']) - ->addColumn('source','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '原物码值']) - ->addColumn('target','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '目标物码']) - ->addColumn('lock','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '锁定状态']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_by','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上传用户']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addIndex('smin', ['name' => 'idb2cdf832_smin']) - ->addIndex('tmin', ['name' => 'idb2cdf832_tmin']) - ->addIndex('lock', ['name' => 'idb2cdf832_lock']) - ->addIndex('status', ['name' => 'idb2cdf832_status']) - ->addIndex('target', ['name' => 'idb2cdf832_target']) - ->addIndex('source', ['name' => 'idb2cdf832_source']) - ->addIndex('deleted', ['name' => 'idb2cdf832_deleted']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaWarehouseStock - * @table plugin_wuma_warehouse_stock - * @return void - */ - private function _create_plugin_wuma_warehouse_stock() { - - // 当前数据表 - $table = 'plugin_wuma_warehouse_stock'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-库存', - ]) - ->addColumn('wcode','string',['limit' => 20, 'default' => '', 'null' => true, 'comment' => '仓库编号']) - ->addColumn('ghash','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品规格']) - ->addColumn('vir_total','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟总数']) - ->addColumn('vir_count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟完成']) - ->addColumn('num_total','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '扫码总数']) - ->addColumn('num_count','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '扫码完成']) - ->addIndex('wcode', ['name' => 'i0344f448b_wcode']) - ->addIndex('ghash', ['name' => 'i0344f448b_ghash']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - - /** - * 创建数据对象 - * @class PluginWumaWarehouseUser - * @table plugin_wuma_warehouse_user - * @return void - */ - private function _create_plugin_wuma_warehouse_user() { - - // 当前数据表 - $table = 'plugin_wuma_warehouse_user'; - - // 存在则跳过 - if ($this->hasTable($table)) return; - - // 创建数据表 - $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-用户', - ]) - ->addColumn('token','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '接口令牌']) - ->addColumn('username','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '用户账号']) - ->addColumn('nickname','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '用户昵称']) - ->addColumn('password','string',['limit' => 32, 'default' => '', 'null' => true, 'comment' => '登录密码']) - ->addColumn('login_ip','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '登录地址']) - ->addColumn('login_time','string',['limit' => 180, 'default' => '', 'null' => true, 'comment' => '登录时间']) - ->addColumn('login_num','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '登录测试']) - ->addColumn('login_vars','string',['limit' => 999, 'default' => '', 'null' => true, 'comment' => '登录参数']) - ->addColumn('remark','string',['limit' => 500, 'default' => '', 'null' => true, 'comment' => '物码描述']) - ->addColumn('sort','biginteger',['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) - ->addColumn('status','integer',['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']) - ->addColumn('deleted','integer',['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_time','datetime',['default' => NULL, 'null' => true, 'comment' => '创建时间']) - ->addColumn('update_time','datetime',['default' => NULL, 'null' => true, 'comment' => '更新时间']) - ->addIndex('sort', ['name' => 'i12b7dd060_sort']) - ->addIndex('token', ['name' => 'i12b7dd060_token']) - ->addIndex('status', ['name' => 'i12b7dd060_status']) - ->addIndex('deleted', ['name' => 'i12b7dd060_deleted']) - ->addIndex('username', ['name' => 'i12b7dd060_username']) - ->addIndex('password', ['name' => 'i12b7dd060_password']) - ->create(); - - // 修改主键长度 - $this->table($table)->changeColumn('id', 'integer', ['limit' => 11, 'identity' => true]); - } - -} diff --git a/database/migrations/20009999999993_install_wechat_table.php b/database/migrations/20009999999993_install_wechat_table.php new file mode 100644 index 000000000..56de0c59c --- /dev/null +++ b/database/migrations/20009999999993_install_wechat_table.php @@ -0,0 +1,334 @@ +_create_wechat_auth(); + $this->_create_wechat_auto(); + $this->_create_wechat_fans(); + $this->_create_wechat_fans_tags(); + $this->_create_wechat_keys(); + $this->_create_wechat_media(); + $this->_create_wechat_news(); + $this->_create_wechat_news_article(); + $this->_create_wechat_payment_record(); + $this->_create_wechat_payment_refund(); + } + + /** + * 创建数据对象 + * @class WechatAuth + * @table wechat_auth + * @return void + */ + private function _create_wechat_auth() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('wechat_auth', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-授权', + ]), [ + ['authorizer_appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '微信APPID']], + ['authorizer_access_token', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '授权Token']], + ['authorizer_refresh_token', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '刷新Token']], + ['expires_in', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => 'Token时限']], + ['user_alias', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号别名']], + ['user_name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '众众号原账号']], + ['user_nickname', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号昵称']], + ['user_headimg', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '公众号头像']], + ['user_signature', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '公众号描述']], + ['user_company', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '公众号公司']], + ['func_info', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号集权']], + ['service_type', 'string', ['limit' => 10, 'default' => '', 'null' => true, 'comment' => '公众号类型']], + ['service_verify', 'string', ['limit' => 10, 'default' => '', 'null' => true, 'comment' => '公众号认证']], + ['qrcode_url', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '公众号二维码']], + ['businessinfo', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '业务序列内容']], + ['miniprograminfo', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '小程序序列内容']], + ['total', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '统计调用次数']], + ['appkey', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '应用接口KEY']], + ['appuri', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '应用接口URI']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '授权状态(0已取消,1已授权)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']], + ['auth_time', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '授权时间']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ], [ + 'status', 'deleted', 'authorizer_appid', + ]); + } + + /** + * 创建数据对象 + * @class WechatAuto + * @table wechat_auto + * @return void + */ + private function _create_wechat_auto() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('wechat_auto', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-回复', + ]), [ + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '类型(text,image,news)']], + ['time', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '延迟时间']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '消息编号']], + ['appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '文本内容']], + ['image_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '图片链接']], + ['voice_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '语音链接']], + ['music_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '音乐标题']], + ['music_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐链接']], + ['music_image', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '缩略图片']], + ['music_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐描述']], + ['video_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '视频标题']], + ['video_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频URL']], + ['video_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频描述']], + ['news_id', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '图文ID']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']], + ['create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ], [ + 'code', 'type', 'time', 'appid', 'status', + ]); + } + + /** + * 创建数据对象 + * @class WechatFans + * @table wechat_fans + * @return void + */ + private function _create_wechat_fans() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('wechat_fans', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-粉丝', + ]), [ + ['appid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公众号APPID']], + ['unionid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝unionid']], + ['openid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝openid']], + ['tagid_list', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝标签id']], + ['is_black', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否为黑名单状态']], + ['subscribe', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '关注状态(0未关注,1已关注)']], + ['nickname', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '用户昵称']], + ['sex', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '用户性别(1男性,2女性,0未知)']], + ['country', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在国家']], + ['province', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在省份']], + ['city', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在城市']], + ['language', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户的语言(zh_CN)']], + ['headimgurl', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']], + ['subscribe_time', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '关注时间']], + ['subscribe_at', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '关注时间']], + ['remark', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '备注']], + ['subscribe_scene', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '扫码关注场景']], + ['qr_scene', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '二维码场景值']], + ['qr_scene_str', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '二维码场景内容']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ], [ + 'appid', 'openid', 'unionid', 'is_black', 'subscribe', + ]); + } + + /** + * 创建数据对象 + * @class WechatFansTags + * @table wechat_fans_tags + * @return void + */ + private function _create_wechat_fans_tags() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('wechat_fans_tags', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-标签', + ]), [ + ['appid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公众号APPID']], + ['name', 'string', ['limit' => 35, 'default' => '', 'null' => true, 'comment' => '标签名称']], + ['count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '粉丝总数']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建日期']], + ], [ + 'id', 'appid', + ]); + } + + /** + * 创建数据对象 + * @class WechatKeys + * @table wechat_keys + * @return void + */ + private function _create_wechat_keys() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('wechat_keys', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-规则', + ]), [ + ['appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']], + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '类型(text,image,news)']], + ['keys', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '关键字']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '文本内容']], + ['image_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '图片链接']], + ['voice_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '语音链接']], + ['music_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '音乐标题']], + ['music_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐链接']], + ['music_image', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '缩略图片']], + ['music_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐描述']], + ['video_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '视频标题']], + ['video_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频URL']], + ['video_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频描述']], + ['news_id', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '图文ID']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序字段']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']], + ['create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ], [ + 'type', 'keys', 'sort', 'appid', 'status', + ]); + } + + /** + * 创建数据对象 + * @class WechatMedia + * @table wechat_media + * @return void + */ + private function _create_wechat_media() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('wechat_media', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-素材', + ]), [ + ['md5', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '文件哈希']], + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '媒体类型']], + ['appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号ID']], + ['media_id', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '永久素材MediaID']], + ['local_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '本地文件链接']], + ['media_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '远程图片链接']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ], [ + 'md5', 'type', 'appid', 'media_id', + ]); + } + + /** + * 创建数据对象 + * @class WechatNews + * @table wechat_news + * @return void + */ + private function _create_wechat_news() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('wechat_news', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-图文', + ]), [ + ['media_id', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '永久素材MediaID']], + ['local_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '永久素材外网URL']], + ['article_id', 'string', ['limit' => 60, 'default' => '', 'null' => true, 'comment' => '关联图文ID(用英文逗号做分割)']], + ['is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ['create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']], + ], [ + 'media_id', 'article_id', + ]); + } + + /** + * 创建数据对象 + * @class WechatNewsArticle + * @table wechat_news_article + * @return void + */ + private function _create_wechat_news_article() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('wechat_news_article', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-文章', + ]), [ + ['title', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '素材标题']], + ['local_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '永久素材URL']], + ['show_cover_pic', 'integer', ['limit' => 4, 'default' => 0, 'null' => true, 'comment' => '显示封面(0不显示,1显示)']], + ['author', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '文章作者']], + ['digest', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '摘要内容']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '图文内容']], + ['content_source_url', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '原文地址']], + ['read_num', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '阅读数量']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ], [ + + ]); + } + + /** + * 创建数据对象 + * @class WechatPaymentRecord + * @table wechat_payment_record + * @return void + */ + private function _create_wechat_payment_record() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('wechat_payment_record', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-支付-行为', + ]), [ + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '交易方式']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '发起支付号']], + ['appid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '发起APPID']], + ['openid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户OPENID']], + ['order_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '原订单编号']], + ['order_name', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '原订单标题']], + ['order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '原订单金额']], + ['payment_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '支付完成时间']], + ['payment_trade', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '平台交易编号']], + ['payment_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态(0未付,1已付,2取消)']], + ['payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际到账金额']], + ['payment_bank', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '支付银行类型']], + ['payment_notify', 'text', ['default' => NULL, 'null' => true, 'comment' => '支付结果通知']], + ['payment_remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '支付状态备注']], + ['refund_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '退款状态(0未退,1已退)']], + ['refund_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退款金额']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'type', 'code', 'appid', 'openid', 'order_code', 'create_time', 'payment_trade', 'payment_status', + ]); + } + + /** + * 创建数据对象 + * @class WechatPaymentRefund + * @table wechat_payment_refund + * @return void + */ + private function _create_wechat_payment_refund() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('wechat_payment_refund', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-支付-退款', + ]), [ + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '发起支付号']], + ['record_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '子支付编号']], + ['refund_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '支付完成时间']], + ['refund_trade', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '平台交易编号']], + ['refund_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态(0未付,1已付,2取消)']], + ['refund_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际到账金额']], + ['refund_account', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '退款目标账号']], + ['refund_scode', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '退款状态码']], + ['refund_remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '支付状态备注']], + ['refund_notify', 'text', ['default' => NULL, 'null' => true, 'comment' => '退款交易通知']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'record_code', 'create_time', 'refund_trade', 'refund_status', + ]); + } + +} diff --git a/database/migrations/20009999999994_install_system_table.php b/database/migrations/20009999999994_install_system_table.php new file mode 100644 index 000000000..f20fe2c69 --- /dev/null +++ b/database/migrations/20009999999994_install_system_table.php @@ -0,0 +1,288 @@ +_create_system_auth(); + $this->_create_system_auth_node(); + $this->_create_system_base(); + $this->_create_system_config(); + $this->_create_system_data(); + $this->_create_system_file(); + $this->_create_system_menu(); + $this->_create_system_oplog(); + $this->_create_system_queue(); + $this->_create_system_user(); + } + + /** + * 创建数据对象 + * @class SystemAuth + * @table system_auth + * @return void + */ + private function _create_system_auth() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('system_auth', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-权限', + ]), [ + ['title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '权限名称']], + ['utype', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '身份权限']], + ['desc', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '备注说明']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '权限状态(1使用,0禁用)']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ], [ + 'sort', 'title', 'status', + ]); + } + + /** + * 创建数据对象 + * @class SystemAuthNode + * @table system_auth_node + * @return void + */ + private function _create_system_auth_node() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('system_auth_node', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-授权', + ]), [ + ['auth', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '角色']], + ['node', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '节点']], + ], [ + 'auth', 'node', + ]); + } + + /** + * 创建数据对象 + * @class SystemBase + * @table system_base + * @return void + */ + private function _create_system_base() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('system_base', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-字典', + ]), [ + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '数据类型']], + ['code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '数据代码']], + ['name', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '数据名称']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '数据内容']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '数据状态(0禁用,1启动)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0正常,1已删)']], + ['deleted_at', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '删除时间']], + ['deleted_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '删除用户']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ], [ + 'type', 'code', 'name', 'sort', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class SystemConfig + * @table system_config + * @return void + */ + private function _create_system_config() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('system_config', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-配置', + ]), [ + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配置分类']], + ['name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '配置名称']], + ['value', 'string', ['limit' => 2048, 'default' => '', 'null' => true, 'comment' => '配置内容']], + ], [ + 'type', 'name', + ]); + } + + /** + * 创建数据对象 + * @class SystemData + * @table system_data + * @return void + */ + private function _create_system_data() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('system_data', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-数据', + ]), [ + ['name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '配置名']], + ['value', 'text', ['default' => NULL, 'null' => true, 'comment' => '配置值']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'name', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class SystemFile + * @table system_file + * @return void + */ + private function _create_system_file() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('system_file', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-文件', + ]), [ + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '上传类型']], + ['hash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '文件哈希']], + ['tags', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '文件标签']], + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '文件名称']], + ['xext', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '文件后缀']], + ['xurl', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '访问链接']], + ['xkey', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '文件路径']], + ['mime', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '文件类型']], + ['size', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文件大小']], + ['uuid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']], + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '会员编号']], + ['isfast', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否秒传']], + ['issafe', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '安全模式']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '上传状态(1悬空,2落地)']], + ['create_at', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_at', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'type', 'hash', 'uuid', 'xext', 'unid', 'tags', 'name', 'status', 'issafe', 'isfast', 'create_at', + ]); + } + + /** + * 创建数据对象 + * @class SystemMenu + * @table system_menu + * @return void + */ + private function _create_system_menu() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('system_menu', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-菜单', + ]), [ + ['pid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级ID']], + ['title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '菜单名称']], + ['icon', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '菜单图标']], + ['node', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '节点代码']], + ['url', 'string', ['limit' => 400, 'default' => '', 'null' => true, 'comment' => '链接节点']], + ['params', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '链接参数']], + ['target', 'string', ['limit' => 20, 'default' => '_self', 'null' => true, 'comment' => '打开方式']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0:禁用,1:启用)']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ], [ + 'pid', 'sort', 'status', + ]); + } + + /** + * 创建数据对象 + * @class SystemOplog + * @table system_oplog + * @return void + */ + private function _create_system_oplog() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('system_oplog', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-日志', + ]), [ + ['node', 'string', ['limit' => 200, 'default' => '', 'null' => false, 'comment' => '当前操作节点']], + ['geoip', 'string', ['limit' => 15, 'default' => '', 'null' => false, 'comment' => '操作者IP地址']], + ['action', 'string', ['limit' => 200, 'default' => '', 'null' => false, 'comment' => '操作行为名称']], + ['content', 'string', ['limit' => 1024, 'default' => '', 'null' => false, 'comment' => '操作内容描述']], + ['username', 'string', ['limit' => 50, 'default' => '', 'null' => false, 'comment' => '操作人用户名']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '创建时间']], + ], [ + 'create_at', + ]); + } + + /** + * 创建数据对象 + * @class SystemQueue + * @table system_queue + * @return void + */ + private function _create_system_queue() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('system_queue', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-任务', + ]), [ + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => false, 'comment' => '任务编号']], + ['title', 'string', ['limit' => 100, 'default' => '', 'null' => false, 'comment' => '任务名称']], + ['command', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '执行指令']], + ['exec_pid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行进程']], + ['exec_data', 'text', ['default' => NULL, 'null' => true, 'comment' => '执行参数']], + ['exec_time', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行时间']], + ['exec_desc', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '执行描述']], + ['enter_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '开始时间']], + ['outer_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '结束时间']], + ['loops_time', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '循环时间']], + ['attempts', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行次数']], + ['message', 'text', ['default' => NULL, 'null' => true, 'comment' => '最新消息']], + ['rscript', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '任务类型(0单例,1多例)']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '任务状态(1新任务,2处理中,3成功,4失败)']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '创建时间']], + ], [ + 'code', 'title', 'status', 'rscript', 'create_at', 'exec_time', + ]); + } + + /** + * 创建数据对象 + * @class SystemUser + * @table system_user + * @return void + */ + private function _create_system_user() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('system_user', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-用户', + ]), [ + ['usertype', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户类型']], + ['username', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户账号']], + ['password', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '用户密码']], + ['nickname', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户昵称']], + ['headimg', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '头像地址']], + ['authorize', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '权限授权']], + ['contact_qq', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系QQ']], + ['contact_mail', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系邮箱']], + ['contact_phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系手机']], + ['login_ip', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '登录地址']], + ['login_at', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '登录时间']], + ['login_num', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '登录次数']], + ['describe', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '备注说明']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']], + ['is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除(1删除,0未删)']], + ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']], + ], [ + 'sort', 'status', 'username', 'is_deleted', + ]); + } + +} diff --git a/database/migrations/20009999999995_install_wuma_table.php b/database/migrations/20009999999995_install_wuma_table.php new file mode 100644 index 000000000..d323e0a6b --- /dev/null +++ b/database/migrations/20009999999995_install_wuma_table.php @@ -0,0 +1,817 @@ +_create_plugin_wuma_code_rule(); + $this->_create_plugin_wuma_code_rule_range(); + $this->_create_plugin_wuma_sales_order(); + $this->_create_plugin_wuma_sales_order_data(); + $this->_create_plugin_wuma_sales_order_data_mins(); + $this->_create_plugin_wuma_sales_order_data_nums(); + $this->_create_plugin_wuma_sales_user(); + $this->_create_plugin_wuma_sales_user_level(); + $this->_create_plugin_wuma_sales_user_stock(); + $this->_create_plugin_wuma_source_assign(); + $this->_create_plugin_wuma_source_assign_item(); + $this->_create_plugin_wuma_source_blockchain(); + $this->_create_plugin_wuma_source_certificate(); + $this->_create_plugin_wuma_source_produce(); + $this->_create_plugin_wuma_source_query(); + $this->_create_plugin_wuma_source_query_notify(); + $this->_create_plugin_wuma_source_query_verify(); + $this->_create_plugin_wuma_source_template(); + $this->_create_plugin_wuma_warehouse(); + $this->_create_plugin_wuma_warehouse_order(); + $this->_create_plugin_wuma_warehouse_order_data(); + $this->_create_plugin_wuma_warehouse_order_data_mins(); + $this->_create_plugin_wuma_warehouse_order_data_nums(); + $this->_create_plugin_wuma_warehouse_relation(); + $this->_create_plugin_wuma_warehouse_relation_data(); + $this->_create_plugin_wuma_warehouse_replace(); + $this->_create_plugin_wuma_warehouse_stock(); + $this->_create_plugin_wuma_warehouse_user(); + } + + /** + * 创建数据对象 + * @class PluginWumaCodeRule + * @table plugin_wuma_code_rule + * @return void + */ + private function _create_plugin_wuma_code_rule() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_code_rule', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-生码-规则', + ]), [ + ['type', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '批次类型(1前关联,2后关联)']], + ['batch', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '批次编号']], + ['mid_min', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '中码与小码比值']], + ['max_mid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '大码与中码比值']], + ['sns_start', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '序号起始值']], + ['sns_after', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '序号结束值']], + ['sns_length', 'biginteger', ['limit' => 20, 'default' => 20, 'null' => true, 'comment' => '序号长度']], + ['max_length', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '大码长度']], + ['mid_length', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '中码长度']], + ['min_length', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '小码长度']], + ['hex_length', 'biginteger', ['limit' => 20, 'default' => 10, 'null' => true, 'comment' => '加密长度']], + ['ver_length', 'biginteger', ['limit' => 20, 'default' => 4, 'null' => true, 'comment' => '验证长度']], + ['max_number', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '大码数量']], + ['mid_number', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '中码数量']], + ['number', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码总数']], + ['template', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '导出模板']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '物码描述']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'type', 'batch', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaCodeRuleRange + * @table plugin_wuma_code_rule_range + * @return void + */ + private function _create_plugin_wuma_code_rule_range() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_code_rule_range', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-生码-范围', + ]), [ + ['type', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '物码类型']], + ['batch', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码批次号']], + ['code_type', 'string', ['limit' => 3, 'default' => '', 'null' => true, 'comment' => '数码类型(min小码,mid中码,max大码)']], + ['code_length', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数码长度']], + ['range_start', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '起始数码']], + ['range_after', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '结束数码']], + ['range_number', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数码数量']], + ], [ + 'type', 'code_type', 'code_length', 'range_start', 'range_after', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSalesOrder + * @table plugin_wuma_sales_order + * @return void + */ + private function _create_plugin_wuma_sales_order() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_sales_order', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-订单', + ]), [ + ['auid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '经销商编号']], + ['xuid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '来源经销商']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作单单号']], + ['mode', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作方式(1扫码,2虚拟)']], + ['ghash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈唏']], + ['vir_need', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟库统计']], + ['vir_count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟库使用']], + ['num_need', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '累计出库数量']], + ['num_count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '累计已经出库']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效,2完成)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'auid', 'xuid', 'code', 'mode', 'ghash', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSalesOrderData + * @table plugin_wuma_sales_order_data + * @return void + */ + private function _create_plugin_wuma_sales_order_data() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_sales_order_data', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-数据', + ]), [ + ['auid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '经销商编号']], + ['xuid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '来源经销商']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作单号']], + ['mode', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作方式(1扫码,2虚拟)']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']], + ['number', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码总数']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'auid', 'xuid', 'mode', 'code', 'status', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSalesOrderDataMins + * @table plugin_wuma_sales_order_data_mins + * @return void + */ + private function _create_plugin_wuma_sales_order_data_mins() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_sales_order_data_mins', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-小码', + ]), [ + ['ddid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数据编号']], + ['auid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理编号']], + ['code', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码数据']], + ['mode', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作类型(1扫码,2虚拟)']], + ['stock', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '库存有效']], + ['ghash', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品哈唏']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '数据状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0有效,1已删)']], + ['status_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '状态时间']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ], [ + 'ddid', 'auid', 'code', 'mode', 'stock', 'ghash', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSalesOrderDataNums + * @table plugin_wuma_sales_order_data_nums + * @return void + */ + private function _create_plugin_wuma_sales_order_data_nums() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_sales_order_data_nums', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-箱码', + ]), [ + ['uuid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属品牌']], + ['ddid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数据编号']], + ['count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码数量']], + ['type', 'string', ['limit' => 40, 'default' => '', 'null' => true, 'comment' => '物码类型']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码数据']], + ], [ + 'type', 'uuid', 'ddid', 'code', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSalesUser + * @table plugin_wuma_sales_user + * @return void + */ + private function _create_plugin_wuma_sales_user() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_sales_user', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-用户', + ]), [ + ['auid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级代理']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '授权编号']], + ['level', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理等级']], + ['master', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '总部账号']], + ['phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户手机']], + ['userid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '身份证号']], + ['mobile', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '联系电话']], + ['headimg', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']], + ['username', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户姓名']], + ['password', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '登录密码']], + ['date_start', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '开始时间']], + ['date_after', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '结束时间']], + ['super_auid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '邀请上级用户']], + ['super_phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '邀请上级手机']], + ['business', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '营业执照']], + ['region_prov', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属省份']], + ['region_city', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属城市']], + ['region_area', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属区域']], + ['region_address', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '详细地址']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户备注描述']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '用户状态(1正常,0已黑)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '注册时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'auid', 'code', 'level', 'status', 'deleted', 'super_auid', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSalesUserLevel + * @table plugin_wuma_sales_user_level + * @return void + */ + private function _create_plugin_wuma_sales_user_level() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_sales_user_level', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-等级', + ]), [ + ['name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '代理级别名称']], + ['number', 'integer', ['limit' => 2, 'default' => 0, 'null' => true, 'comment' => '代理级别序号']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '代理级别描述']], + ['utime', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '等级更新时间']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '代理等级状态(1使用,0禁用)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '等级创建时间']], + ], [ + 'status', 'number', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSalesUserStock + * @table plugin_wuma_sales_user_stock + * @return void + */ + private function _create_plugin_wuma_sales_user_stock() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_sales_user_stock', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-代理-库存', + ]), [ + ['auid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '经销编号']], + ['ghash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈唏']], + ['vir_total', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟库存']], + ['vir_count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟出货']], + ['num_total', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '累计库存']], + ['num_count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '累计出货']], + ], [ + 'auid', 'ghash', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSourceAssign + * @table plugin_wuma_source_assign + * @return void + */ + private function _create_plugin_wuma_source_assign() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_source_assign', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-赋码批次', + ]), [ + ['type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '赋码类型(0区间,1关联)']], + ['batch', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '赋码批次号']], + ['cbatch', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码批次号']], + ['outer_items', 'text', ['default' => NULL, 'null' => true, 'comment' => 'JSON出库']], + ['coder_items2', 'text', ['default' => NULL, 'null' => true, 'comment' => 'JSON赋码']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'type', 'batch', 'cbatch', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSourceAssignItem + * @table plugin_wuma_source_assign_item + * @return void + */ + private function _create_plugin_wuma_source_assign_item() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_source_assign_item', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-赋码规则', + ]), [ + ['real', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否真锁定']], + ['lock', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否已锁定']], + ['batch', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '赋码批次号']], + ['cbatch', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码批次号']], + ['pbatch', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '生产批次号']], + ['range_start', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '开始物码区间']], + ['range_after', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '结束物码区间']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'lock', 'real', 'batch', 'cbatch', 'pbatch', 'range_start', 'range_after', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSourceBlockchain + * @table plugin_wuma_source_blockchain + * @return void + */ + private function _create_plugin_wuma_source_blockchain() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_source_blockchain', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-区块链', + ]), [ + ['scid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '确权证书']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '流程编号']], + ['hash', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '流程HASH']], + ['name', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '流程名称']], + ['data', 'text', ['default' => NULL, 'null' => true, 'comment' => '流程环节']], + ['remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '流程备注']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删1已删)']], + ['hash_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '上链时间']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'scid', 'sort', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSourceCertificate + * @table plugin_wuma_source_certificate + * @return void + */ + private function _create_plugin_wuma_source_certificate() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_source_certificate', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-确权证书', + ]), [ + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '模板编号']], + ['name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '模板名称']], + ['times', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '访问次数']], + ['image', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '证书底图']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '定制规则']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSourceProduce + * @table plugin_wuma_source_produce + * @return void + */ + private function _create_plugin_wuma_source_produce() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_source_produce', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-生产批次', + ]), [ + ['batch', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '生产批次']], + ['ghash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '产品编号']], + ['tcode', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '关联溯源模板']], + ['addr_prov', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '所在省份']], + ['addr_city', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '所在城市']], + ['addr_area', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '所在区域']], + ['remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '批次备注']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效1有效)']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'batch', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSourceQuery + * @table plugin_wuma_source_query + * @return void + */ + private function _create_plugin_wuma_source_query() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_source_query', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-查询记录', + ]), [ + ['auid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理用户']], + ['code', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '小码数码']], + ['ghash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈希']], + ['times', 'biginteger', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '查询次数']], + ['encode', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '物码编号']], + ['prov', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所在省份']], + ['city', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所在城市']], + ['area', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所在区域']], + ['addr', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '详细地址']], + ['geoip', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '访问IP']], + ['gtype', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '定位类型']], + ['latlng', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '经纬度']], + ['notify', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '窜货状态']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'auid', 'prov', 'city', 'area', 'notify', 'encode', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSourceQueryNotify + * @table plugin_wuma_source_query_notify + * @return void + */ + private function _create_plugin_wuma_source_query_notify() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_source_query_notify', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-窜货异常', + ]), [ + ['auid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理用户']], + ['code', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '小码数码']], + ['type', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '记录类型']], + ['times', 'biginteger', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '查询次数']], + ['encode', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '物码编号']], + ['prov', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所在省份']], + ['city', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所在城市']], + ['area', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所在区域']], + ['addr', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '详细地址']], + ['gtype', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '定位类型']], + ['geoip', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '访问IP']], + ['latlng', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '经纬度']], + ['pcode', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']], + ['pspec', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '商品规格']], + ['agent_prov', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '代理省份']], + ['agent_city', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '代理城市']], + ['agent_area', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '代理区域']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'auid', 'prov', 'city', 'area', 'code', 'encode', 'agent_prov', 'agent_city', 'agent_area', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSourceQueryVerify + * @table plugin_wuma_source_query_verify + * @return void + */ + private function _create_plugin_wuma_source_query_verify() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_source_query_verify', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-查询记录', + ]), [ + ['auid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理用户']], + ['code', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '小码数码']], + ['times', 'biginteger', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '查询次数']], + ['ghash', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']], + ['encode', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '物码编号']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'auid', 'encode', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaSourceTemplate + * @table plugin_wuma_source_template + * @return void + */ + private function _create_plugin_wuma_source_template() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_source_template', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '溯源-页面模板', + ]), [ + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '模板编号']], + ['name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '模板名称']], + ['times', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '访问次数']], + ['styles', 'text', ['default' => NULL, 'null' => true, 'comment' => '主题样式']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '模板内容']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaWarehouse + * @table plugin_wuma_warehouse + * @return void + */ + private function _create_plugin_wuma_warehouse() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_warehouse', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库', + ]), [ + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '仓库编号']], + ['name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '仓库名称']], + ['person', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '负责人']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '物码描述']], + ['addr_prov', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属省份']], + ['addr_city', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属城市']], + ['addr_area', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所属区域']], + ['addr_text', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '详细地址']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'name', 'sort', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaWarehouseOrder + * @table plugin_wuma_warehouse_order + * @return void + */ + private function _create_plugin_wuma_warehouse_order() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_warehouse_order', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-订单', + ]), [ + ['type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '操作类型(1订单入库,2直接入库,3调货入库,4订单出库,5直接出库,6调货出库,7关联出库,8直接退货)']], + ['mode', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作方式(1扫码操作,2虚拟操作)']], + ['auid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '出库代理']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作单号']], + ['wcode', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '仓库编号']], + ['ghash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '绑定产品']], + ['vir_need', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟总数']], + ['vir_used', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟完成']], + ['num_need', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '扫码总数']], + ['num_used', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '扫码完成']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效,2完成)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ['deleted_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '删除时间']], + ], [ + 'mode', 'auid', 'type', 'code', 'ghash', 'wcode', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaWarehouseOrderData + * @table plugin_wuma_warehouse_order_data + * @return void + */ + private function _create_plugin_wuma_warehouse_order_data() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_warehouse_order_data', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-数据', + ]), [ + ['type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '操作类型(1订单入库,2直接入库,3调货入库,4订单出库,5直接出库,6调货出库,7关联出库,8直接退货)']], + ['mode', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作方式(1扫码操作,2虚拟操作)']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作单号']], + ['number', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '标签总数']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ], [ + 'mode', 'type', 'code', 'status', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaWarehouseOrderDataMins + * @table plugin_wuma_warehouse_order_data_mins + * @return void + */ + private function _create_plugin_wuma_warehouse_order_data_mins() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_warehouse_order_data_mins', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-小码', + ]), [ + ['type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '操作类型(1订单入库,2直接入库,3调货入库,4订单出库,5直接出库,6调货出库,7关联出库,8直接退货)']], + ['mode', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '操作方式(1扫码操作,2虚拟操作)']], + ['ddid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数据编号']], + ['code', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码数据']], + ['stock', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '调货:库存有效(0已出,1暂存)']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '退货:记录状态(0无效,1有效)']], + ['status_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '状态时间']], + ], [ + 'type', 'mode', 'ddid', 'code', 'stock', 'status', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaWarehouseOrderDataNums + * @table plugin_wuma_warehouse_order_data_nums + * @return void + */ + private function _create_plugin_wuma_warehouse_order_data_nums() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_warehouse_order_data_nums', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-箱码', + ]), [ + ['ddid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '数据编号']], + ['type', 'string', ['limit' => 40, 'default' => '', 'null' => true, 'comment' => '物码类型']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码数据']], + ['count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '物码数量']], + ], [ + 'ddid', 'code', 'type', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaWarehouseRelation + * @table plugin_wuma_warehouse_relation + * @return void + */ + private function _create_plugin_wuma_warehouse_relation() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_warehouse_relation', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-关联', + ]), [ + ['max', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '大码数值']], + ['mid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '中码数值']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上传用户']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ], [ + 'max', 'mid', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaWarehouseRelationData + * @table plugin_wuma_warehouse_relation_data + * @return void + */ + private function _create_plugin_wuma_warehouse_relation_data() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_warehouse_relation_data', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-关联', + ]), [ + ['rid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '批次数据']], + ['max', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '大码数值']], + ['mid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '中码数值']], + ['min', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '小码数值']], + ['number', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '防窜编码']], + ['encode', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '防伪编码']], + ['lock', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '锁定状态']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上传用户']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ], [ + 'rid', 'max', 'mid', 'min', 'lock', 'status', 'encode', 'number', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaWarehouseReplace + * @table plugin_wuma_warehouse_replace + * @return void + */ + private function _create_plugin_wuma_warehouse_replace() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_warehouse_replace', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-替换', + ]), [ + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物码类型']], + ['smin', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '原值小码']], + ['tmin', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '目标小码']], + ['source', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '原物码值']], + ['target', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '目标物码']], + ['lock', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '锁定状态']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上传用户']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ], [ + 'smin', 'tmin', 'lock', 'status', 'target', 'source', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaWarehouseStock + * @table plugin_wuma_warehouse_stock + * @return void + */ + private function _create_plugin_wuma_warehouse_stock() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_warehouse_stock', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-库存', + ]), [ + ['wcode', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '仓库编号']], + ['ghash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品规格']], + ['vir_total', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟总数']], + ['vir_count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟完成']], + ['num_total', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '扫码总数']], + ['num_count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '扫码完成']], + ], [ + 'wcode', 'ghash', + ]); + } + + /** + * 创建数据对象 + * @class PluginWumaWarehouseUser + * @table plugin_wuma_warehouse_user + * @return void + */ + private function _create_plugin_wuma_warehouse_user() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wuma_warehouse_user', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '物码-仓库-用户', + ]), [ + ['token', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '接口令牌']], + ['username', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '用户账号']], + ['nickname', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '用户昵称']], + ['password', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '登录密码']], + ['login_ip', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '登录地址']], + ['login_time', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '登录时间']], + ['login_num', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '登录测试']], + ['login_vars', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '登录参数']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '物码描述']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'sort', 'token', 'status', 'deleted', 'username', 'password', + ]); + } + +} diff --git a/database/migrations/20009999999996_install_wemall_table.php b/database/migrations/20009999999996_install_wemall_table.php new file mode 100644 index 000000000..03f38ceca --- /dev/null +++ b/database/migrations/20009999999996_install_wemall_table.php @@ -0,0 +1,1205 @@ +_create_plugin_wemall_config_agent(); + $this->_create_plugin_wemall_config_coupon(); + $this->_create_plugin_wemall_config_discount(); + $this->_create_plugin_wemall_config_level(); + $this->_create_plugin_wemall_config_notify(); + $this->_create_plugin_wemall_config_poster(); + $this->_create_plugin_wemall_config_rebate(); + $this->_create_plugin_wemall_express_company(); + $this->_create_plugin_wemall_express_template(); + $this->_create_plugin_wemall_goods(); + $this->_create_plugin_wemall_goods_cate(); + $this->_create_plugin_wemall_goods_item(); + $this->_create_plugin_wemall_goods_mark(); + $this->_create_plugin_wemall_goods_stock(); + $this->_create_plugin_wemall_help_feedback(); + $this->_create_plugin_wemall_help_problem(); + $this->_create_plugin_wemall_help_question(); + $this->_create_plugin_wemall_help_question_x(); + $this->_create_plugin_wemall_order(); + $this->_create_plugin_wemall_order_cart(); + $this->_create_plugin_wemall_order_item(); + $this->_create_plugin_wemall_order_refund(); + $this->_create_plugin_wemall_order_send(); + $this->_create_plugin_wemall_order_sender(); + $this->_create_plugin_wemall_user_action_collect(); + $this->_create_plugin_wemall_user_action_comment(); + $this->_create_plugin_wemall_user_action_history(); + $this->_create_plugin_wemall_user_action_search(); + $this->_create_plugin_wemall_user_checkin(); + $this->_create_plugin_wemall_user_coupon(); + $this->_create_plugin_wemall_user_create(); + $this->_create_plugin_wemall_user_rebate(); + $this->_create_plugin_wemall_user_recharge(); + $this->_create_plugin_wemall_user_relation(); + $this->_create_plugin_wemall_user_transfer(); + } + + /** + * 创建数据对象 + * @class PluginWemallConfigAgent + * @table plugin_wemall_config_agent + * @return void + */ + private function _create_plugin_wemall_config_agent() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_config_agent', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-等级', + ]), [ + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '级别名称']], + ['cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '等级图标']], + ['cardbg', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '等级卡片']], + ['number', 'integer', ['limit' => 2, 'default' => 0, 'null' => true, 'comment' => '级别序号']], + ['upgrade_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '升级规则(0单个,1同时)']], + ['extra', 'text', ['default' => NULL, 'null' => true, 'comment' => '升级规则']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '级别描述']], + ['utime', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '更新时间']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '等级状态(1使用,0禁用)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'utime', 'status', 'number', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallConfigCoupon + * @table plugin_wemall_config_coupon + * @return void + */ + private function _create_plugin_wemall_config_coupon() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_config_coupon', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-卡券', + ]), [ + ['type', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '类型(0通用券,1商品券)']], + ['name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '优惠名称']], + ['cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '封面图标']], + ['extra', 'text', ['default' => NULL, 'null' => true, 'comment' => '扩展数据']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '内容描述']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '系统备注']], + ['amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '抵扣金额']], + ['limit_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '金额门槛(0不限制)']], + ['limit_levels', 'string', ['limit' => 180, 'default' => '-', 'null' => true, 'comment' => '授权等级']], + ['limit_times', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '限领数量(0不限制)']], + ['expire_days', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '有效天数']], + ['total_stock', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '库存数量']], + ['total_sales', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '发放数量']], + ['total_used', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '使用数量']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '卡券状态(0禁用,1使用)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'sort', 'type', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallConfigDiscount + * @table plugin_wemall_config_discount + * @return void + */ + private function _create_plugin_wemall_config_discount() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_config_discount', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-折扣', + ]), [ + ['name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '方案名称']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '方案描述']], + ['items', 'text', ['default' => NULL, 'null' => true, 'comment' => '方案规则']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '方案状态(0禁用,1使用)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'sort', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallConfigLevel + * @table plugin_wemall_config_level + * @return void + */ + private function _create_plugin_wemall_config_level() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_config_level', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-等级', + ]), [ + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '级别名称']], + ['cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '等级图标']], + ['cardbg', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '等级卡片']], + ['number', 'integer', ['limit' => 2, 'default' => 0, 'null' => true, 'comment' => '级别序号']], + ['upgrade_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '升级规则(0单个,1同时)']], + ['upgrade_team', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '团队人数统计(0不计,1累计)']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户级别描述']], + ['extra', 'text', ['default' => NULL, 'null' => true, 'comment' => '配置规则']], + ['utime', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '更新时间']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '等级状态(1使用,0禁用)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'utime', 'status', 'number', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallConfigNotify + * @table plugin_wemall_config_notify + * @return void + */ + private function _create_plugin_wemall_config_notify() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_config_notify', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-通知', + ]), [ + ['code', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '通知编号']], + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '通知标题']], + ['cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '通知图片']], + ['levels', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户等级']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '通知内容']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '通知描述']], + ['num_read', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '阅读次数']], + ['tips', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => 'TIPS显示']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '激活状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'sort', 'name', 'tips', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallConfigPoster + * @table plugin_wemall_config_poster + * @return void + */ + private function _create_plugin_wemall_config_poster() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_config_poster', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-海报', + ]), [ + ['code', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '推广编号']], + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '推广标题']], + ['levels', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户等级']], + ['devices', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '接口通道']], + ['image', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '推广图片']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '二维位置']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '推广描述']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '激活状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'sort', 'name', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallConfigRebate + * @table plugin_wemall_config_rebate + * @return void + */ + private function _create_plugin_wemall_config_rebate() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_config_rebate', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-配置-返利', + ]), [ + ['type', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '奖励类型']], + ['code', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '配置编号']], + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '配置名称']], + ['path', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '等级关系']], + ['stype', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '结算类型(0支付结算,1收货结算)']], + ['p0_level', 'biginteger', ['limit' => 20, 'default' => -1, 'null' => true, 'comment' => '会员等级']], + ['p1_level', 'biginteger', ['limit' => 20, 'default' => -1, 'null' => true, 'comment' => '上1级等级']], + ['p2_level', 'biginteger', ['limit' => 20, 'default' => -1, 'null' => true, 'comment' => '上2级等级']], + ['p3_level', 'biginteger', ['limit' => 20, 'default' => -1, 'null' => true, 'comment' => '上3级等级']], + ['p0_reward_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '会员计算类型(0固定金额,1交易比例,2利润比例)']], + ['p0_reward_number', 'decimal', ['precision' => 20, 'scale' => 6, 'default' => '0.000000', 'null' => true, 'comment' => '会员计算系数']], + ['p1_reward_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '上1级计算类型(0固定金额,1交易比例,2利润比例)']], + ['p1_reward_number', 'decimal', ['precision' => 20, 'scale' => 6, 'default' => '0.000000', 'null' => true, 'comment' => '上1级计算系数']], + ['p2_reward_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '上2级计算类型(0固定金额,1交易比例,2利润比例)']], + ['p2_reward_number', 'decimal', ['precision' => 20, 'scale' => 6, 'default' => '0.000000', 'null' => true, 'comment' => '上2级计算系数']], + ['p3_reward_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '上3级计算类型(0固定金额,1交易比例,2利润比例)']], + ['p3_reward_number', 'decimal', ['precision' => 20, 'scale' => 6, 'default' => '0.000000', 'null' => true, 'comment' => '上3级计算系数']], + ['remark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '配置描述']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '激活状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'sort', 'name', 'type', 'stype', 'status', 'deleted', 'p1_level', 'p2_level', 'p3_level', 'p0_level', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallExpressCompany + * @table plugin_wemall_express_company + * @return void + */ + private function _create_plugin_wemall_express_company() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_express_company', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-公司', + ]), [ + ['code', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公司代码']], + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '公司名称']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '公司描述']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '激活状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'sort', 'name', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallExpressTemplate + * @table plugin_wemall_express_template + * @return void + */ + private function _create_plugin_wemall_express_template() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_express_template', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-模板', + ]), [ + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '模板编号']], + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '模板名称']], + ['normal', 'text', ['default' => NULL, 'null' => true, 'comment' => '默认规则']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '模板规则']], + ['company', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '快递公司']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '激活状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'sort', 'name', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallGoods + * @table plugin_wemall_goods + * @return void + */ + private function _create_plugin_wemall_goods() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_goods', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-内容', + ]), [ + ['ssid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']], + ['name', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '商品名称']], + ['marks', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品标签']], + ['cates', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '分类编号']], + ['cover', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品封面']], + ['slider', 'text', ['default' => NULL, 'null' => true, 'comment' => '轮播图片']], + ['specs', 'text', ['default' => NULL, 'null' => true, 'comment' => '商品规格(JSON)']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '商品详情']], + ['remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品描述']], + ['stock_total', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品库存统计']], + ['stock_sales', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品销售统计']], + ['stock_virtual', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品虚拟销量']], + ['price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最低销售价格']], + ['price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最低市场价格']], + ['allow_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大积分兑换']], + ['allow_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大余额支付']], + ['rebate_type', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '参与返利(0无需返利,1需要返利)']], + ['delivery_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物流运费模板']], + ['limit_lowvip', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '限制购买等级(0不限制,其他限制)']], + ['limit_maxnum', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '最大购买数量(0不限制,其他限制)']], + ['level_agent', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推广权益(0无,1有)']], + ['level_upgrade', 'biginteger', ['limit' => 20, 'default' => -1, 'null' => true, 'comment' => '购买升级等级(-1非入会,0不升级,其他升级)']], + ['discount_id', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '折扣方案编号(0无折扣,其他折扣)']], + ['num_read', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '访问阅读统计']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '列表排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态(1使用,0禁用)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'sort', 'ssid', 'status', 'deleted', 'rebate_type', 'discount_id', 'create_time', 'level_agent', 'level_upgrade', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallGoodsCate + * @table plugin_wemall_goods_cate + * @return void + */ + private function _create_plugin_wemall_goods_cate() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_goods_cate', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-分类', + ]), [ + ['pid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级分类']], + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '分类名称']], + ['cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '分类图标']], + ['remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '分类描述']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '使用状态']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'pid', 'sort', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallGoodsItem + * @table plugin_wemall_goods_item + * @return void + */ + private function _create_plugin_wemall_goods_item() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_goods_item', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-规格', + ]), [ + ['gsku', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品SKU']], + ['ghash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈希']], + ['gcode', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']], + ['gspec', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '商品规格']], + ['gunit', 'string', ['limit' => 10, 'default' => '件', 'null' => true, 'comment' => '商品单位']], + ['gimage', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '商品图片']], + ['stock_sales', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '销售数量']], + ['stock_total', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品库存']], + ['price_cost', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '进货成本']], + ['price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '销售价格']], + ['price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '市场价格']], + ['allow_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '兑换积分']], + ['allow_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '余额支付']], + ['reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励余额']], + ['reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励积分']], + ['number_virtual', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟销量']], + ['number_express', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '计件系数']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'gcode', 'gspec', 'ghash', 'status', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallGoodsMark + * @table plugin_wemall_goods_mark + * @return void + */ + private function _create_plugin_wemall_goods_mark() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_goods_mark', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-标签', + ]), [ + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '标签名称']], + ['remark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '标签描述']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '标签状态(1使用,0禁用)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'sort', 'status', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallGoodsStock + * @table plugin_wemall_goods_stock + * @return void + */ + private function _create_plugin_wemall_goods_stock() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_goods_stock', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-库存', + ]), [ + ['batch_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作批量']], + ['ghash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈希']], + ['gcode', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']], + ['gspec', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商品规格']], + ['gstock', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '入库数量']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '数据状态(1使用,0禁用)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'ghash', 'gcode', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallHelpFeedback + * @table plugin_wemall_help_feedback + * @return void + */ + private function _create_plugin_wemall_help_feedback() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_help_feedback', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-意见-反馈', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '反馈用户']], + ['phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系电话']], + ['images', 'text', ['default' => NULL, 'null' => true, 'comment' => '反馈图片']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '反馈内容']], + ['reply', 'text', ['default' => NULL, 'null' => true, 'comment' => '回复内容']], + ['reply_st', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '回复状态']], + ['reply_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '回复用户']], + ['reply_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '回复时间']], + ['sync', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '同步至常见问题状态(1已同步,0未同步)']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '展示状态(1使用,0禁用)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'sort', 'unid', 'status', 'deleted', 'reply_st', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallHelpProblem + * @table plugin_wemall_help_problem + * @return void + */ + private function _create_plugin_wemall_help_problem() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_help_problem', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-常见-问题', + ]), [ + ['fid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => false, 'comment' => '来自反馈']], + ['name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '问题标题']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '问题内容']], + ['num_er', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '未解决数']], + ['num_ok', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '已解决数']], + ['num_read', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '阅读次数']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '展示状态(1使用,0禁用)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'sort', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallHelpQuestion + * @table plugin_wemall_help_question + * @return void + */ + private function _create_plugin_wemall_help_question() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_help_question', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-问答-内容', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '提问用户']], + ['name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '工单标题']], + ['phone', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '联系电话']], + ['order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '关联订单']], + ['images', 'text', ['default' => NULL, 'null' => true, 'comment' => '工单图片']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '工单描述']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '工单状态(0取消,1新工单,2后台回复,3前台回复,4已完结)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'sort', 'name', 'unid', 'phone', 'status', 'deleted', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallHelpQuestionX + * @table plugin_wemall_help_question_x + * @return void + */ + private function _create_plugin_wemall_help_question_x() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_help_question_x', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-问答-评论', + ]), [ + ['ccid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '目标编号']], + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '文本内容']], + ['images', 'text', ['default' => NULL, 'null' => true, 'comment' => '图片内容']], + ['reply_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '后台用户']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1待审核,2已审核)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'ccid', 'unid', 'status', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallOrder + * @table plugin_wemall_order + * @return void + */ + private function _create_plugin_wemall_order() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_order', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-内容', + ]), [ + ['ssid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']], + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']], + ['puid1', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上1级代理']], + ['puid2', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上2级代理']], + ['puid3', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上3级代理']], + ['order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']], + ['order_ps', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '订单备注']], + ['amount_cost', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品成本']], + ['amount_real', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际金额']], + ['amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单金额']], + ['amount_goods', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品金额']], + ['amount_profit', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '销售利润']], + ['amount_reduct', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '随机减免']], + ['amount_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '余额支付']], + ['amount_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '积分抵扣']], + ['amount_payment', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '金额支付']], + ['amount_express', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '快递费用']], + ['amount_discount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '折扣后金额']], + ['coupon_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '优惠券编号']], + ['coupon_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '优惠券金额']], + ['allow_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大余额支付']], + ['allow_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大积分抵扣']], + ['ratio_integral', 'decimal', ['precision' => 20, 'scale' => 6, 'default' => '0.000000', 'null' => true, 'comment' => '积分兑换比例']], + ['number_goods', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品数量']], + ['number_express', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计数']], + ['level_agent', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '升级代理等级']], + ['level_member', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '升级会员等级']], + ['rebate_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '返利金额']], + ['reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励余额']], + ['reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励积分']], + ['payment_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '支付时间']], + ['payment_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态(0未支付,1有支付)']], + ['payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际支付']], + ['delivery_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '物流类型(0无配送,1需配送)']], + ['cancel_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '取消时间']], + ['cancel_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '取消状态']], + ['cancel_remark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '取消描述']], + ['deleted_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '删除时间']], + ['deleted_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['deleted_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '删除描述']], + ['confirm_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '签收时间']], + ['confirm_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '签收描述']], + ['refund_code', 'string', ['limit' => 20, 'default' => NULL, 'null' => true, 'comment' => '售后单号']], + ['refund_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '售后状态(0未售后,1预订单,2待审核,3待退货,4已退货,5待退款,6已退款,7已完成)']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '流程状态(0已取消,1预订单,2待支付,3待审核,4待发货,5已发货,6已收货,7已评论)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'ssid', 'puid1', 'puid2', 'puid3', 'status', 'order_no', 'create_time', 'refund_code', 'coupon_code', 'delivery_type', 'cancel_status', 'refund_status', 'deleted_status', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallOrderCart + * @table plugin_wemall_order_cart + * @return void + */ + private function _create_plugin_wemall_order_cart() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_order_cart', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-购物车', + ]), [ + ['ssid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']], + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']], + ['ghash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '规格哈希']], + ['gcode', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']], + ['gspec', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '商品规格']], + ['number', 'biginteger', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '商品数量']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'ssid', 'gcode', 'gspec', 'ghash', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallOrderItem + * @table plugin_wemall_order_item + * @return void + */ + private function _create_plugin_wemall_order_item() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_order_item', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-商品', + ]), [ + ['ssid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']], + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']], + ['gsku', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品SKU']], + ['ghash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品哈希']], + ['gcode', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']], + ['gspec', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商品规格']], + ['gunit', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商品单凭']], + ['gname', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '商品名称']], + ['gcover', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品封面']], + ['order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']], + ['stock_sales', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '包含商品数量']], + ['amount_cost', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品成本单价']], + ['price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品市场单价']], + ['price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品销售单价']], + ['total_price_cost', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品成本总价']], + ['total_price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品市场总价']], + ['total_price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品销售总价']], + ['total_allow_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大余额支付']], + ['total_allow_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最大兑换总分']], + ['total_reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品奖励余额']], + ['total_reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品奖励积分']], + ['level_code', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户等级序号']], + ['level_name', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '用户等级名称']], + ['level_agent', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推广权益(0无,1有)']], + ['level_upgrade', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '购买升级等级(-1非入会,0不升级,其他升级)']], + ['rebate_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '参与返利状态(0不返,1返利)']], + ['rebate_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '参与返利金额']], + ['delivery_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递邮费模板']], + ['delivery_count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计费基数']], + ['discount_id', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '优惠方案编号']], + ['discount_rate', 'decimal', ['precision' => 20, 'scale' => 6, 'default' => '100.000000', 'null' => true, 'comment' => '销售价格折扣']], + ['discount_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品优惠金额']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态(1使用,0禁用)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'gsku', 'ssid', 'gcode', 'gspec', 'ghash', 'status', 'deleted', 'order_no', 'rebate_type', 'discount_id', 'level_agent', 'delivery_code', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallOrderRefund + * @table plugin_wemall_order_refund + * @return void + */ + private function _create_plugin_wemall_order_refund() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_order_refund', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-售后', + ]), [ + ['ssid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']], + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']], + ['type', 'biginteger', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '申请类型(1退货退款,2仅退款)']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '售后单号']], + ['order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']], + ['reason', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '退款原因']], + ['number', 'biginteger', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '退货数量']], + ['amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '申请金额']], + ['payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退款支付']], + ['balance_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退款余额']], + ['integral_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退款积分']], + ['payment_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '退款单号']], + ['balance_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '退回单号']], + ['integral_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '退回单号']], + ['phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系电话']], + ['images', 'text', ['default' => NULL, 'null' => true, 'comment' => '申请图片']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '申请说明']], + ['remark', 'string', ['limit' => 180, 'default' => NULL, 'null' => true, 'comment' => '操作描述']], + ['express_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递单号']], + ['express_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递公司']], + ['express_name', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '快递名称']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '流程状态(0已取消,1预订单,2待审核,3待退货,4已退货,5待退款,6已退款,7已完成)']], + ['status_at', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '状态变更时间']], + ['status_ds', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '状态变更描述']], + ['admin_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '后台用户']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'type', 'code', 'ssid', 'status', 'order_no', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallOrderSend + * @table plugin_wemall_order_send + * @return void + */ + private function _create_plugin_wemall_order_send() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_order_send', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-配送', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商城用户编号']], + ['order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城订单单号']], + ['address_id', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送地址编号']], + ['user_idcode', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '收货人证件号码']], + ['user_idimg1', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '收货人证件正面']], + ['user_idimg2', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '收货人证件反面']], + ['user_name', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '收货人联系名称']], + ['user_phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '收货人联系手机']], + ['region_prov', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的省份']], + ['region_city', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的城市']], + ['region_area', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的区域']], + ['region_addr', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '配送的详细地址']], + ['delivery_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送模板编号']], + ['delivery_count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计费基数']], + ['delivery_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '配送计算金额']], + ['delivery_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '配送计算描述']], + ['express_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递发送时间']], + ['express_code', 'string', ['limit' => 80, 'default' => '', 'null' => true, 'comment' => '快递运送单号']], + ['express_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '快递发送备注']], + ['company_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递公司编码']], + ['company_name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '快递公司名称']], + ['extra', 'text', ['default' => NULL, 'null' => true, 'comment' => '原始数据']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '发货状态(1待发货,2已发货,3已收货)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'status', 'deleted', 'order_no', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallOrderSender + * @table plugin_wemall_order_sender + * @return void + */ + private function _create_plugin_wemall_order_sender() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_order_sender', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-配送', + ]), [ + ['ssid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']], + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商城用户编号']], + ['order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城订单单号']], + ['address_id', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送地址编号']], + ['user_idcode', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '收货人证件号码']], + ['user_idimg1', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '收货人证件正面']], + ['user_idimg2', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '收货人证件反面']], + ['user_name', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '收货人联系名称']], + ['user_phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '收货人联系手机']], + ['region_prov', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的省份']], + ['region_city', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的城市']], + ['region_area', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的区域']], + ['region_addr', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '配送的详细地址']], + ['delivery_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送模板编号']], + ['delivery_count', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计费基数']], + ['delivery_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '配送计算金额']], + ['delivery_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '配送计算描述']], + ['express_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递发送时间']], + ['express_code', 'string', ['limit' => 80, 'default' => '', 'null' => true, 'comment' => '快递运送单号']], + ['express_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '快递发送备注']], + ['company_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递公司编码']], + ['company_name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '快递公司名称']], + ['extra', 'text', ['default' => NULL, 'null' => true, 'comment' => '原始数据']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '发货状态(1待发货,2已发货,3已收货)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'ssid', 'status', 'deleted', 'order_no', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserActionCollect + * @table plugin_wemall_user_action_collect + * @return void + */ + private function _create_plugin_wemall_user_action_collect() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_action_collect', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-收藏', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']], + ['gcode', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品编号']], + ['times', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '记录次数']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'sort', 'gcode', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserActionComment + * @table plugin_wemall_user_action_comment + * @return void + */ + private function _create_plugin_wemall_user_action_comment() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_action_comment', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-评论', + ]), [ + ['ssid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']], + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']], + ['code', 'string', ['limit' => 32, 'default' => NULL, 'null' => true, 'comment' => '评论编号']], + ['gcode', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']], + ['ghash', 'string', ['limit' => 32, 'default' => NULL, 'null' => true, 'comment' => '商品哈希']], + ['order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']], + ['rate', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '5.00', 'null' => true, 'comment' => '评论分数']], + ['content', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '评论内容']], + ['images', 'text', ['default' => NULL, 'null' => true, 'comment' => '评论图片']], + ['status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '评论状态(0隐藏,1显示)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'code', 'ssid', 'ghash', 'gcode', 'status', 'deleted', 'order_no', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserActionHistory + * @table plugin_wemall_user_action_history + * @return void + */ + private function _create_plugin_wemall_user_action_history() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_action_history', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-足迹', + ]), [ + ['ssid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属商家']], + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']], + ['gcode', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '商品编号']], + ['times', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '记录次数']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'sort', 'ssid', 'gcode', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserActionSearch + * @table plugin_wemall_user_action_search + * @return void + */ + private function _create_plugin_wemall_user_action_search() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_action_search', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-搜索', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']], + ['keys', 'string', ['limit' => 99, 'default' => '', 'null' => true, 'comment' => '关键词']], + ['times', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '搜索次数']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'keys', 'unid', 'sort', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserCheckin + * @table plugin_wemall_user_checkin + * @return void + */ + private function _create_plugin_wemall_user_checkin() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_checkin', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '业务-活动-签到', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UNID']], + ['times', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '连续天数']], + ['timed', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '奖励天数']], + ['date', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '签到日期']], + ['balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '赠送余额']], + ['integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '赠送积分']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '生效状态(0未生效,1已生效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'date', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserCoupon + * @table plugin_wemall_user_coupon + * @return void + */ + private function _create_plugin_wemall_user_coupon() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_coupon', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-卡券', + ]), [ + ['type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '卡券类型']], + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UNID']], + ['coid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '配置编号']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '卡券编号']], + ['used', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '使用状态']], + ['used_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '使用时间']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '生效状态(0未生效,1待使用,2已使用,3已过期)']], + ['status_desc', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '状态描述']], + ['status_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '修改时间']], + ['expire', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '有效时间']], + ['expire_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '有效日期']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ['confirm_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '到账时间']], + ], [ + 'code', 'unid', 'coid', 'used', 'status', 'expire', 'deleted', 'create_time', 'confirm_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserCreate + * @table plugin_wemall_user_create + * @return void + */ + private function _create_plugin_wemall_user_create() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_create', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-创建', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => false, 'comment' => '关联用户']], + ['name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '用户姓名']], + ['phone', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '手机号码']], + ['headimg', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']], + ['password', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '初始密码']], + ['rebate_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '累计返利']], + ['rebate_total_code', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '记录编号']], + ['rebate_total_desc', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '记录描述']], + ['rebate_usable', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '可提返利']], + ['rebate_usable_code', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '记录编号']], + ['rebate_usable_desc', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '记录描述']], + ['agent_entry', 'tinyinteger', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '代理权限']], + ['agent_phone', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '上级手机']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1有效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'name', 'unid', 'phone', 'status', 'deleted', 'create_time', 'agent_entry', 'agent_phone', 'rebate_total', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserRebate + * @table plugin_wemall_user_rebate + * @return void + */ + private function _create_plugin_wemall_user_rebate() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_rebate', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-返利', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UNID']], + ['layer', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级层级']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励编号']], + ['hash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '维一编号']], + ['date', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励日期']], + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励类型']], + ['name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '奖励名称']], + ['amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励数量']], + ['order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']], + ['order_unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '订单用户']], + ['order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单金额']], + ['remark', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '奖励描述']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '生效状态(0未生效,1已生效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ['confirm_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '到账时间']], + ], [ + 'type', 'date', 'code', 'name', 'unid', 'hash', 'status', 'deleted', 'order_no', 'order_unid', 'create_time', 'confirm_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserRecharge + * @table plugin_wemall_user_recharge + * @return void + */ + private function _create_plugin_wemall_user_recharge() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_recharge', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-充值', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '账号编号']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作编号']], + ['name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '操作名称']], + ['remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '操作备注']], + ['amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作金额']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']], + ['create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '系统用户']], + ['deleted_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '系统用户']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['deleted_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '删除时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'code', 'deleted', 'create_time', 'deleted_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserRelation + * @table plugin_wemall_user_relation + * @return void + */ + private function _create_plugin_wemall_user_relation() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_relation', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-关系', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '当前用户']], + ['puids', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '绑定状态']], + ['puid1', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上1级代理']], + ['puid2', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上2级代理']], + ['puid3', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上3级代理']], + ['layer', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '所属层级']], + ['path', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '关系路径']], + ['extra', 'text', ['default' => NULL, 'null' => true, 'comment' => '扩展数据']], + ['entry_agent', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '推广权益(0无,1有)']], + ['entry_member', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '入会礼包(0无,1有)']], + ['level_code', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '会员等级']], + ['level_name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '会员名称']], + ['agent_uuid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '绑定用户']], + ['agent_state', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '绑定状态']], + ['agent_level_code', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '代理等级']], + ['agent_level_name', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '代理名称']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'path', 'puid1', 'puid2', 'puid3', 'level_code', 'agent_uuid', 'create_time', 'entry_agent', 'entry_member', 'agent_level_code', + ]); + } + + /** + * 创建数据对象 + * @class PluginWemallUserTransfer + * @table plugin_wemall_user_transfer + * @return void + */ + private function _create_plugin_wemall_user_transfer() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_wemall_user_transfer', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-用户-提现', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UNID']], + ['type', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '提现方式']], + ['date', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '提现日期']], + ['code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '提现单号']], + ['appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']], + ['openid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号OPENID']], + ['username', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号真实姓名']], + ['charge_rate', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '提现手续费比例']], + ['charge_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '提现手续费金额']], + ['amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '提现转账金额']], + ['qrcode', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '收款码图片地址']], + ['bank_wseq', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '微信银行编号']], + ['bank_name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户银行名称']], + ['bank_bran', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户分行名称']], + ['bank_user', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户账号姓名']], + ['bank_code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户银行卡号']], + ['alipay_user', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付宝姓名']], + ['alipay_code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付宝账号']], + ['remark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '提现描述']], + ['trade_no', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '交易单号']], + ['trade_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '打款时间']], + ['change_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '处理时间']], + ['change_desc', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '处理描述']], + ['audit_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '审核时间']], + ['audit_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '审核状态']], + ['audit_remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '审核描述']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'unid', 'date', 'type', 'appid', 'openid', 'status', 'create_time', 'audit_status', + ]); + } + +} diff --git a/database/migrations/20009999999997_install_payment_table.php b/database/migrations/20009999999997_install_payment_table.php new file mode 100644 index 000000000..2b1a16dc8 --- /dev/null +++ b/database/migrations/20009999999997_install_payment_table.php @@ -0,0 +1,231 @@ +_create_plugin_payment_address(); + $this->_create_plugin_payment_balance(); + $this->_create_plugin_payment_config(); + $this->_create_plugin_payment_integral(); + $this->_create_plugin_payment_record(); + $this->_create_plugin_payment_refund(); + } + + /** + * 创建数据对象 + * @class PluginPaymentAddress + * @table plugin_payment_address + * @return void + */ + private function _create_plugin_payment_address() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_payment_address', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-地址', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '主账号ID']], + ['type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '默认状态(0普通,1默认)']], + ['idcode', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '身体证证号']], + ['idimg1', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '身份证正面']], + ['idimg2', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '身份证反面']], + ['user_name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '收货人姓名']], + ['user_phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '收货人手机']], + ['region_prov', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-省份']], + ['region_city', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-城市']], + ['region_area', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-区域']], + ['region_addr', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '地址-详情']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删,0未删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'type', 'unid', 'deleted', 'user_phone', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginPaymentBalance + * @table plugin_payment_balance + * @return void + */ + private function _create_plugin_payment_balance() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_payment_balance', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-余额', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '账号编号']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作编号']], + ['name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '操作名称']], + ['remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '操作备注']], + ['amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作金额']], + ['amount_prev', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作前金额']], + ['amount_next', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作后金额']], + ['cancel', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '作废状态(0未作废,1已作废)']], + ['unlock', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '解锁状态(0锁定中,1已生效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']], + ['create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '系统用户']], + ['cancel_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '作废时间']], + ['unlock_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '解锁时间']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['deleted_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '删除时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'code', 'cancel', 'unlock', 'deleted', 'create_time', 'deleted_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginPaymentConfig + * @table plugin_payment_config + * @return void + */ + private function _create_plugin_payment_config() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_payment_config', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-配置', + ]), [ + ['type', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '支付类型']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '通道编号']], + ['name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付名称']], + ['cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '支付图标']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '支付说明']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '支付参数']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '支付状态(1使用,0禁用)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'type', 'code', 'sort', 'status', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginPaymentIntegral + * @table plugin_payment_integral + * @return void + */ + private function _create_plugin_payment_integral() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_payment_integral', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-积分', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '账号编号']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作编号']], + ['name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '操作名称']], + ['remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '操作备注']], + ['amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作金额']], + ['amount_prev', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作前金额']], + ['amount_next', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '操作后金额']], + ['cancel', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '作废状态(0未作废,1已作废)']], + ['unlock', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '解锁状态(0锁定中,1已生效)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']], + ['create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '系统用户']], + ['cancel_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '作废时间']], + ['unlock_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '解锁时间']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['deleted_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '删除时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'code', 'cancel', 'unlock', 'deleted', 'create_time', 'deleted_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginPaymentRecord + * @table plugin_payment_record + * @return void + */ + private function _create_plugin_payment_record() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_payment_record', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-行为', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '主账号编号']], + ['usid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '子账号编号']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '发起支付号']], + ['order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '原订单编号']], + ['order_name', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '原订单标题']], + ['order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '原订单金额']], + ['channel_type', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '支付通道类型']], + ['channel_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '支付通道编号']], + ['payment_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '支付生效时间']], + ['payment_trade', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '平台交易编号']], + ['payment_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态(0未付,1已付,2取消)']], + ['payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际支付金额']], + ['payment_coupon', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '平台优惠券金额']], + ['payment_images', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '凭证支付图片']], + ['payment_remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '支付状态备注']], + ['payment_notify', 'text', ['default' => NULL, 'null' => true, 'comment' => '支付通知内容']], + ['audit_user', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '审核用户(系统用户ID)']], + ['audit_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '审核时间']], + ['audit_status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '审核状态(0已拒,1待审,2已审)']], + ['audit_remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '审核描述']], + ['refund_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '退款状态(0未退,1已退)']], + ['refund_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '累计退款']], + ['refund_payment', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回金额']], + ['refund_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回余额']], + ['refund_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回积分']], + ['used_payment', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '支付金额']], + ['used_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '扣除余额']], + ['used_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '扣除积分']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'usid', 'code', 'order_no', 'create_time', 'audit_status', 'channel_type', 'channel_code', 'payment_trade', 'refund_status', 'payment_status', + ]); + } + + /** + * 创建数据对象 + * @class PluginPaymentRefund + * @table plugin_payment_refund + * @return void + */ + private function _create_plugin_payment_refund() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_payment_refund', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-支付-退款', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '主账号编号']], + ['usid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '子账号编号']], + ['code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '发起支付号']], + ['record_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '子支付编号']], + ['refund_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '完成时间']], + ['refund_trade', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '交易编号']], + ['refund_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态(0未付,1已付,2取消)']], + ['refund_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退款金额']], + ['refund_account', 'string', ['limit' => 180, 'default' => '', 'null' => true, 'comment' => '退回账号']], + ['refund_scode', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '状态编码']], + ['refund_remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '退款备注']], + ['refund_notify', 'text', ['default' => NULL, 'null' => true, 'comment' => '通知内容']], + ['used_payment', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回金额']], + ['used_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回余额']], + ['used_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '退回积分']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'unid', 'usid', 'code', 'record_code', 'create_time', 'refund_trade', 'refund_status', 'refund_account', + ]); + } + +} diff --git a/database/migrations/20009999999998_install_account_table.php b/database/migrations/20009999999998_install_account_table.php new file mode 100644 index 000000000..b03964f1d --- /dev/null +++ b/database/migrations/20009999999998_install_account_table.php @@ -0,0 +1,142 @@ +_create_plugin_account_auth(); + $this->_create_plugin_account_bind(); + $this->_create_plugin_account_msms(); + $this->_create_plugin_account_user(); + } + + /** + * 创建数据对象 + * @class PluginAccountAuth + * @table plugin_account_auth + * @return void + */ + private function _create_plugin_account_auth() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_account_auth', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-账号-授权', + ]), [ + ['usid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '终端账号']], + ['time', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '有效时间']], + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '授权类型']], + ['token', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '授权令牌']], + ['tokenv', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '授权验证']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'usid', 'type', 'time', 'token', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginAccountBind + * @table plugin_account_bind + * @return void + */ + private function _create_plugin_account_bind() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_account_bind', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-账号-终端', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '会员编号']], + ['type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '终端类型']], + ['phone', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '绑定手机']], + ['appid', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => 'APPID']], + ['openid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => 'OPENID']], + ['unionid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => 'UnionID']], + ['headimg', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']], + ['nickname', 'string', ['limit' => 99, 'default' => '', 'null' => true, 'comment' => '用户昵称']], + ['password', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '登录密码']], + ['extra', 'text', ['default' => NULL, 'null' => true, 'comment' => '扩展数据']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '账号状态']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '注册时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'type', 'unid', 'sort', 'phone', 'appid', 'status', 'openid', 'unionid', 'deleted', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginAccountMsms + * @table plugin_account_msms + * @return void + */ + private function _create_plugin_account_msms() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_account_msms', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-账号-短信', + ]), [ + ['unid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => false, 'comment' => '账号编号']], + ['usid', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => false, 'comment' => '终端编号']], + ['type', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '短信类型']], + ['scene', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '业务场景']], + ['smsid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '消息编号']], + ['phone', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '目标手机']], + ['result', 'string', ['limit' => 512, 'default' => '', 'null' => true, 'comment' => '返回结果']], + ['params', 'string', ['limit' => 512, 'default' => '', 'null' => true, 'comment' => '短信内容']], + ['status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '短信状态(0失败,1成功)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '创建时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'type', 'usid', 'unid', 'phone', 'smsid', 'scene', 'status', 'create_time', + ]); + } + + /** + * 创建数据对象 + * @class PluginAccountUser + * @table plugin_account_user + * @return void + */ + private function _create_plugin_account_user() + { + // 创建更新数据表 + PhinxExtend::upgrade($this->table('plugin_account_user', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '插件-账号-资料', + ]), [ + ['code', 'string', ['limit' => 16, 'default' => '', 'null' => true, 'comment' => '用户编号']], + ['phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户手机']], + ['email', 'string', ['limit' => 99, 'default' => '', 'null' => true, 'comment' => '用户邮箱']], + ['unionid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => 'UnionID']], + ['username', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户姓名']], + ['nickname', 'string', ['limit' => 99, 'default' => '', 'null' => true, 'comment' => '用户昵称']], + ['password', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '认证密码']], + ['headimg', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']], + ['region_prov', 'string', ['limit' => 99, 'default' => '', 'null' => true, 'comment' => '所在省份']], + ['region_city', 'string', ['limit' => 99, 'default' => '', 'null' => true, 'comment' => '所在城市']], + ['region_area', 'string', ['limit' => 99, 'default' => '', 'null' => true, 'comment' => '所在区域']], + ['remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '备注(内部使用)']], + ['extra', 'text', ['default' => NULL, 'null' => true, 'comment' => '扩展数据']], + ['sort', 'biginteger', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']], + ['status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '用户状态(0拉黑,1正常)']], + ['deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']], + ['create_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '注册时间']], + ['update_time', 'datetime', ['default' => NULL, 'null' => true, 'comment' => '更新时间']], + ], [ + 'code', 'sort', 'phone', 'email', 'status', 'unionid', 'deleted', 'username', 'nickname', 'region_prov', 'region_city', 'region_area', 'create_time', + ]); + } + +} diff --git a/database/migrations/20009999999971_install_package.php b/database/migrations/20009999999999_install_package.php similarity index 99% rename from database/migrations/20009999999971_install_package.php rename to database/migrations/20009999999999_install_package.php index dd15ae1ce..f1f947f4b 100644 --- a/database/migrations/20009999999971_install_package.php +++ b/database/migrations/20009999999999_install_package.php @@ -20,7 +20,6 @@ class InstallPackage extends Migrator /** * 数据库初始化 * @return void - * @throws \think\db\exception\DbException */ public function change() { @@ -33,7 +32,6 @@ class InstallPackage extends Migrator /** * 安装扩展数据 * @return void - * @throws \think\db\exception\DbException */ private function inserData() {