1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace app\logics;
- use app\model\QuestionCompany;
- use app\model\QuestionBank;
- class QuestionLogic
- {
- public function list($where , $page , $limit)
- {
- return QuestionCompany::where($where)->page($page , $limit)->order('addtime desc')->select();
- }
- public function count($where)
- {
- return QuestionCompany::where($where)->count();
- }
- //创建考卷
- public function create_question($title)
- {
- $QuestionId = QuestionBank::column('id');
- dump(array_rand($QuestionId , 2));exit;
- $data = [
- 'title' => $title,
- 'cmid' =>2,
- 'question_id' => '',
- 'score' => 100,
- ];
- return QuestionCompany::insert($data);
- }
- public function del($id)
- {
- return QuestionCompany::where('id',$id)->setField('del',1);
- }
- }
|