我用webman-admin,生成了一個前臺模塊,
是基于上表生成的,
運行很正常,
但是,我在首頁寫如下代碼,卻不行
<?php
namespace app\controller;
use support\Request;
use support\Response;
use app\model\Buy;
use plugin\admin\app\controller\Crud;
use support\exception\BusinessException;
class IndexController extends Crud
{
public function index(Request $request)
{
// Webman 使用 ThinkORM 進行查詢
$zj = Db::table('fg_buy')
->field('yh, SUM(xse) as total_xse')
->group('yh')
->order('total_xse', 'desc')
->limit(10)
->select();
return json(['code' => 0, 'msg' => 'ok','data' =>$zj]);
}
}
完全運行不了,請問各位大咖,我該怎么寫?