You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
44
hyhproject/mobile2/controller/Goodsappraises.php
Executable file
44
hyhproject/mobile2/controller/Goodsappraises.php
Executable file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace wstmart\mobile\controller;
|
||||
use wstmart\common\model\GoodsAppraises as M;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 评价控制器
|
||||
*/
|
||||
class GoodsAppraises extends Base{
|
||||
// 前置方法执行列表
|
||||
protected $beforeActionList = [
|
||||
'checkAuth' => ['except'=>'getbyid'],// 只要访问only下的方法才才需要执行前置操作
|
||||
];
|
||||
/**
|
||||
* 根据商品id获取评论
|
||||
*/
|
||||
public function getById(){
|
||||
$m = new M();
|
||||
$rs = $m->getById();
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 根据订单id,用户id,商品id获取评价
|
||||
*/
|
||||
public function getAppr(){
|
||||
$m = model('GoodsAppraises');
|
||||
$rs = $m->getAppr();
|
||||
if(!empty($rs['data']['images'])){
|
||||
$imgs = explode(',',$rs['data']['images']);
|
||||
foreach($imgs as $k=>$v){
|
||||
$imgs[$k] = WSTImg($v,1);
|
||||
}
|
||||
$rs['data']['images'] = $imgs;
|
||||
}
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 添加评价
|
||||
*/
|
||||
public function add(){
|
||||
$m = new M();
|
||||
$rs = $m->add();
|
||||
return $rs;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user