| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace app\api\controller;
- use app\common\model\StockConfig;
- use app\common\model\ShopList;
- use app\common\model\StockLog;
- use think\exception\ValidateException;
- use app\api\validate\Stock as StockValidate;
- use app\common\model\StockDetail;
- use think\facade\Db;
- //记账记录表
- class MoneyLog extends Base
- {
- //首页数据分组统计品种
- public function index(StockLog $stockLog)
- {
- $data= $stockLog->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));
- }
-
-
- }
|