We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$model = $this->modelsManager->createBuilder() ->addFrom('warmup\models2\SubjectClassesList', 'l') ->columns('c.*') ->leftJoin('warmup\models2\Classes', 'l.classesid = c.id', 'c') ->where('l.subjectid = :subjectid: AND c.status <> :status:', ['subjectid' => $subjectid, 'status' => Classes::STATUS_DELETE]) ->orderBy('c.utime DESC') ->limit($count, $start) ->getQuery() ->execute()->toArray();
\Phalcon\Mvc\Model::setup( [ 'castOnHydrate' => true ] );
CREATE TABLE `subject_classes_list` ( `subjectid` int(10) unsigned NOT NULL COMMENT '课程专题id', `classesid` int(10) unsigned NOT NULL COMMENT '课程id', PRIMARY KEY (`subjectid`,`classesid`), KEY `index2` (`classesid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `classes` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '课程id', `categories_id` int(10) unsigned DEFAULT '0' COMMENT '分类标签id', `type` tinyint(4) unsigned DEFAULT NULL COMMENT '课程类型 1:单节课程 2:重复课程 3:多开课时间课程', `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '课程状态 1:正常;2:草稿;3下架', `userid` int(10) unsigned NOT NULL COMMENT '发起课程的用户id', `name` varchar(128) NOT NULL COMMENT '课程名称', `description` varchar(255) NOT NULL DEFAULT '' COMMENT '课程简介', `information` text, `images` text NOT NULL COMMENT '课程图片', `key_words` varchar(300) DEFAULT NULL COMMENT '关键词', `citycode` int(10) unsigned NOT NULL COMMENT '城市编码', `areacode` int(10) unsigned NOT NULL COMMENT '区编码', `address` varchar(128) NOT NULL DEFAULT '' COMMENT '课程地址', `longitude` decimal(9,6) unsigned NOT NULL COMMENT '上课地点经度 最多为9位 其中整数3位小数6位', `latitude` decimal(9,6) unsigned NOT NULL COMMENT '上课地点纬度 最多为9位 其中整数3位小数6位', `price` decimal(11,2) unsigned NOT NULL COMMENT '价格 最多为11位 其中整数9位小数2位', `buymin` int(11) unsigned DEFAULT '0' COMMENT '课程最少购买次数', `times_required` tinyint(3) unsigned DEFAULT '0' COMMENT '所需课时', `like_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '喜欢过课程的人数', `view_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '课程阅读次数', `amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总名额', `booked_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已报名数', `starttime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '课程开始时间', `endtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '课程结束时间', `ctime` int(10) unsigned NOT NULL COMMENT '课程创建时间', `utime` int(10) unsigned NOT NULL COMMENT '课程更新时间', PRIMARY KEY (`id`), UNIQUE KEY `name_UNIQUE` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
The text was updated successfully, but these errors were encountered:
@lxholding Could you please provide script to reproduce?
Sorry, something went wrong.
Fixed in the 3.0.x branch.
3.0.x
No branches or pull requests
phalcon:2.0.9
database:mysql
my code:
when i use below setup:
throw a error msg: "Phalcon\Mvc\Model\Exception: Column 'id' is not part of the column map"
table: subject_classes_list
table: classes
The text was updated successfully, but these errors were encountered: