| 123456789101112131415161718192021222324 |
- <?php
- namespace app\admin\model;
- use think\Model;
- class Finishedproduct extends Model
- {
- protected $connection = 'mongodb';
- protected $table = 'finished_products';
- // protected $append = ['status_text'];
- protected static function init()
- {
- self::afterInsert(function ($row) {
- $pk = $row->getPk();
- $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
- });
- }
- }
|