first commit
This commit is contained in:
47
application/mobile/controller/Cause.php
Normal file
47
application/mobile/controller/Cause.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
// +------------------------------------------------+
|
||||
// |http://www.cjango.com |
|
||||
// +------------------------------------------------+
|
||||
// | 修复BUG不是一朝一夕的事情,等我喝醉了再说吧! |
|
||||
// +------------------------------------------------+
|
||||
// | Author: 小陈叔叔 <Jason.Chen> |
|
||||
// +------------------------------------------------+
|
||||
namespace app\mobile\controller;
|
||||
|
||||
use app\common\model\Content as ContentModel;
|
||||
use app\common\service\Content as ContentService;
|
||||
|
||||
class Cause extends _Init
|
||||
{
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->nav = 2;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->list = ContentService::categoryList('cause');
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function lists($category)
|
||||
{
|
||||
$this->list = ContentModel::where('category_id', $category)->where('status', 1)->order('create_time desc')->paginate(20);
|
||||
if (IS_AJAX) {
|
||||
if (count($this->list) > 0) {
|
||||
return $this->success($this->fetch('cause/list'));
|
||||
} else {
|
||||
return $this->error('已经到最后一页');
|
||||
}
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function detail($id)
|
||||
{
|
||||
parent::shareArticle();
|
||||
$this->info = ContentModel::where('id', $id)->where('status', 1)->find();
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user