代支付记录

This commit is contained in:
2025-01-04 15:29:44 +08:00
parent 2852aeec1b
commit 2948b2b6a4
5 changed files with 83 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ class ChargeCashController extends BaseAdminController
}
$query->with(['store'])->orderBy(['id' => SORT_DESC]);
$query->with(['store', 'supplier'])->orderBy(['id' => SORT_DESC]);
$this->field = [
ChargeCashPayRecord::class => [
'id',
@@ -46,7 +46,9 @@ class ChargeCashController extends BaseAdminController
'charge_cash',
'type',
'status',
'store',
'store' => function ($query) {
return empty($query->store)? $query->supplier: $query->store;
},
'created_at' => function ($le) {
return date('Y-m-d H:i:s', $le->created_at);
}

View File

@@ -0,0 +1,19 @@
<?php
namespace common\models\newDb;
use yii\behaviors\TimestampBehavior;
class CardModel extends \common\modelsgii\newDb\CardModelGii
{
public function behaviors()
{
return [
[
'class' => TimestampBehavior::class,
'attributes' => [
],
],
];
}
}

View File

@@ -16,4 +16,9 @@ class SupplierModel extends \common\modelsgii\newDb\SupplierModelGii
],
];
}
public function getCard()
{
return $this->hasOne(CardModel::class, ['user_id' => 'id']);
}
}

View File

@@ -2,6 +2,7 @@
namespace common\models\oldDb;
use common\models\newDb\SupplierModel;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
@@ -27,4 +28,9 @@ class ChargeCashPayRecord extends \common\modelsgii\oldDb\ChargeCashPayRecord
{
return $this->hasOne(Store::class, ['id'=>'store_id']);
}
public function getSupplier()
{
return $this->hasOne(SupplierModel::class, ['id'=>'store_id']);
}
}

View File

@@ -0,0 +1,49 @@
<?php
namespace common\modelsgii\newDb;
/**
* This is the model class for table "yii_address".
*
* @property int $id
* @property int $user_id
* @property string $name
* @property string $mobile
* @property string $province 省
* @property string $city 市
* @property string $area 区
* @property string $region 省市区
* @property string $detail_address 详细地址
* @property int $is_default 是否默认地址0否1是
* @property int $created_at
* @property int $updated_at
* @property int $deleted_at
*/
class CardModelGii extends \common\core\BaseNewActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return '{{%card}}';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
];
}
}