where('user_id', $this->userinfo['id']) ->field('type,count(id) as count') ->group('type') ->select(); $this->success('ok', $data); } //记账 public function money(StockConfig $stockConfig, StockDetail $stockDetail) { $result = []; $list = $stockConfig->where('status', $stockConfig::StatusNormal)->field('id,type_id,title') ->orderRaw("field('variety_name','packing_box','material')")->select(); $this->success('ok', $result); } /** * @return void 全部类型图标 */ public function getConfig() { $type = $this->request->post('type/s', 'bank_account'); if(!in_array($type, ['bank_account', 'money_in_type', 'money_out_type'])) $this->error('参数有误'); $this->success('提交成功', site_config('addonsd.'.$type)); } }