# 生成ea_test_goods表的CURD
php think curd -t test_goods
# 生成ea_test_goods表的CURD, 文件冲突时强制覆盖
php think curd -t test_goods -f 1
# 删除ea_test_goods表的CURD
php think curd -t test_goods -d 1
# 生成ea_test_goods表的CURD, 控制器在目录demo下的Goods.php文件
php think curd -t test_goods -c demo/Goods
# 生成ea_test_goods表的CURD, 模型在目录demo下的Goods.php文件
php think curd -t test_goods -m demo/Goods
# 生成ea_test_goods表的CURD, 并关联ea_test_cate表, 并设置外键为cate_id
php think curd -t test_goods -r test_cate --foreignKey=cate_id --primaryKey=id
# 生成ea_test_goods表的CURD, 并关联ea_test_cate表, 并设置只显示title,image两个字段php think curd -t test_goods -r test_cate --foreignKey=cate_id --relationOnlyFields=title,image
# 生成ea_test_goods表的CURD, 并关联ea_test_cate表, 并设置主表外键cate_id在表单的下拉选择显示的关联表的title字段
php think curd -t test_goods -r test_cate --foreignKey=cate_id --relationBindSelect=title# 生成ea_test_goods表的CURD, 并设置logo字段后缀为单图片
php think curd -t test_goods --imageFieldSuffix=logo
# 生成ea_test_goods表的CURD, 并设置忽略remark, stock字段
php think curd -t test_goods --ignoreFields=remark --ignoreFields=stock

参数介绍

短参长参说明
-t--table=VALUE主表名
-c--controllerFilename=VALUE控制器文件名
-m--modelFilename=VALUE主表模型文件名
-f--force=VALUE强制覆盖模式
-d--delete=VALUE删除模式

--checkboxFieldSuffix=VALUE复选框字段后缀

--radioFieldSuffix=VALUE单选框字段后缀

--imageFieldSuffix=VALUE单图片字段后缀

--imagesFieldSuffix=VALUE多图片字段后缀

--fileFieldSuffix=VALUE单文件字段后缀

--filesFieldSuffix=VALUE多文件字段后缀

--dateFieldSuffix=VALUE时间字段后缀

--switchFields=VALUE开关的字段

--selectFields=VALUE下拉的字段

--editorFields=VALUE富文本的字段

--sortFields=VALUE排序的字段

--ignoreFields=VALUE忽略的字段
-r--relationTable=VALUE关联表名

--foreignKey=VALUE关联外键

--primaryKey=VALUE关联主键

--relationOnlyFields=VALUE关联模型中只显示的字段

--relationBindSelect=VALUE关联模型中的字段用于主表外键的表单下拉选择

--relationModelFilename=VALUE关联模型文件名


点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部
0.184279s