初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\model\goods;
|
||||
|
||||
use think\Model;
|
||||
|
||||
use app\common\exception\Exception;
|
||||
/**
|
||||
* 商品-课程
|
||||
*/
|
||||
class Course extends Model
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct($data = [])
|
||||
{
|
||||
|
||||
$this->model = new \app\admin\model\course\Course();
|
||||
|
||||
|
||||
$this->columnBindModel = new \app\admin\model\course\ColumnBind();
|
||||
$this->groupBindModel = new \app\admin\model\course\GroupBind();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取课程详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDetail($id){
|
||||
|
||||
$row = $this->model->field(['id','name','cover','status','price','price_marking','pay_type','sales','type','sales_type'])->find($id);
|
||||
if (!$row) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $row;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user