2020-08-16 15:16:43 +08:00

30 lines
739 B
PHP

<?php
namespace wstmart\app\controller;
use think\Db;
class TradeRule extends Base
{
public function index()
{
$model = Db::name("trade_rule")->field(true)
->order("create_time", "desc")
->select();
return WSTReturn("OK", 1, $model);
}
public function detail()
{
if(($id = (int)input( 'id', 0)) > 0){
$detail = Db::name("trade_rule")->field(true)
->where(["id"=>$id])->find();
$detail['content'] = htmlspecialchars_decode($detail['content']);
if(!$detail) return WSTReturn("该条内容已被删除",0);
return WSTReturn("OK", 1, $detail);
}
return WSTReturn("异常请求",0);
}
}