| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | <?phpnamespace app\admin\controller\member;use app\admin\validate\member\RuleAddedValidate;use app\admin\validate\member\RulePricingValidate;use app\controller\Curd;use app\model\RuleAdded;use app\model\RuleAddedComponent;use app\model\RulePricing;use app\model\SysSerial;use support\exception\BusinessException;use support\Request;use support\Response;class RuleAddedComponentController extends Curd{    public function __construct()    {        $this->model = new RuleAddedComponent();//        $this->validate = true;//        $this->validateClass = new RuleAddedValidate();    }    public function select(Request $request): Response    {        [$where, $format, $limit, $field, $order] = $this->selectInput($request);        $order = $request->get('order', 'desc');        $field = $field ?? 'rule_added_component_addtimes';        $query = $this->doSelect($where, $field, $order);        return $this->doFormat($query, $format, $limit);    }//    protected function updateInput(Request $request): array//    {//        $primary_key = $this->model->getKeyName();//        $id = $request->post($primary_key);//        $data = $this->inputFilter($request->post());//        if (!empty($data['rule_pricing_goods_json'])) {//            $data['rule_pricing_goods_json'] = json_encode(explode(',', $data['rule_pricing_goods_json']));//        } else {//            $data['rule_pricing_goods_json'] = '[]';//        }//        $model = $this->model->find($id);//        if (!$model) {//            throw new BusinessException('记录不存在', 2);//        }//        unset($data[$primary_key]);//        return [$id, $data];//    }}
 |