<?php

namespace App\Api\Controllers;

use App\Http\Controllers\BaseApiController;
use App\Models\DrugModel;
use Illuminate\Http\Request;

// 药品控制器
class DrugController extends BaseApiController
{
    public function test()
    {
        return $this->success(['a' => 1, 'b' => 2, 'c' => 3]);
    }

    // 药品列表
    public function drugList(Request $request)
    {
        // $code = $request->input('code');
        #  TODO 通过药店编号筛选药品列表
        # pharmacy_id = $request->input('code');
        $data = DrugModel::query()->paginate(10);

        // $total = DrugModel::query()->count();
        // $data = [
        //     'data'=>$drugList,
        //     'total'=>$total
        // ];
        return $this->success($data);
    }
}
