| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace app\common\model;
- class PaymentChannelModel extends BaseModel
- {
- protected $table = 'erp_payment_channel';
- protected function genSchema(array $schema)
- {
- // TODO: Implement genSchema() method.
- }
- protected function relation() {
- return $this->hasMany(CreditCardConfigModel::class,'channel_id', 'id')->where('is_delete',0);
- }
- public function findAll() {
- return $this->where('is_delete', 0)
- ->with('relation')
- ->order("id", "Asc")
- ->select();
- }
- public function findById($id)
- {
- return $this->with('relation')->where([
- ['is_delete', '=', 0],
- ['id', "=", $id]
- ])->find();
- }
- public function findByName($name) {
- return $this->where([
- ['is_delete', '=', 0],
- ['name', "=", $name]
- ])->find();
- }
- }
|